/* ============================================================
   NORTHMARK CREATIVE — SHARED DESIGN SYSTEM
   Signature: the site is built like a reel — scenes, slates,
   timecode, and a viewfinder frame borrowed from the edit bay.
   ============================================================ */

:root {
    --navy: #17140f;         /* ink — dark brand surface / dark text */
    --navy-deep: #0b0906;    /* deepest ink — hovers, deepest bg */
    --gold: #e2492c;         /* tally — the one signature accent (rec-light red) */
    --gold-soft: rgba(226, 73, 44, 0.14);
    --cream: #f4eedf;        /* paper — light surface */
    --paper-2: #ece3cd;      /* deeper paper — alt strata / card fields */
    --ink: #211d17;          /* body text on paper */
    --muted: #7c7566;        /* secondary text, warm grey-brown */
    --hair: #e3dbc8;         /* hairline borders on paper */
    --brass: #a8823d;        /* secondary metal accent — dividers, mono labels */
    --cream-line: rgba(244, 238, 223, 0.16);
}

* { scroll-behavior: smooth; box-sizing: border-box; }

body {
    background: var(--cream);
    color: var(--ink);
    font-family: 'Sora', sans-serif;
    font-weight: 400;
}

h1, h2, h3, .display {
    font-family: 'Big Shoulders Display', sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.hero-headline {
    font-family: 'Big Shoulders Display', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.005em;
}

.font-btn { font-family: 'Sora', sans-serif; font-weight: 600; }

.font-accent {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.font-mono { font-family: 'IBM Plex Mono', monospace; }

/* ---- Slate label: mono eyebrow with scene number, like a clapperboard ---- */
.slate-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.slate-label::before {
    content: "";
    width: 20px;
    height: 1px;
    background: var(--brass);
    display: inline-block;
}
.slate-label.on-dark { color: var(--cream); opacity: 0.65; }
.slate-label.on-dark::before { background: var(--cream); opacity: 0.5; }

.accent-underline { position: relative; }
.accent-underline::after {
    content: "";
    position: absolute; left: 0; bottom: -6px;
    width: 42px; height: 3px;
    background: var(--gold); border-radius: 2px;
}

/* ---- Letterbox bars (cinematic framing) ---- */
.letterbox-bar {
    position: relative; height: 28px; overflow: hidden; background: var(--navy);
}
.letterbox-bar .ticks {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: space-between; padding: 0 6vw; opacity: 0.35;
}
.letterbox-bar .ticks span { width: 1px; height: 8px; background: var(--cream); }

/* ---- Viewfinder corner brackets — the signature motif ---- */
.frame-corners { position: relative; }
.frame-corners::before,
.frame-corners::after,
.frame-corners .corner-tl,
.frame-corners .corner-br {
    content: ""; position: absolute; width: 22px; height: 22px;
    border-color: var(--gold); z-index: 3; pointer-events: none;
    transition: width .3s ease, height .3s ease;
}
.frame-corners::before { top: 10px; left: 10px; border-top: 2px solid; border-left: 2px solid; }
.frame-corners::after { bottom: 10px; right: 10px; border-bottom: 2px solid; border-right: 2px solid; }
.frame-corners:hover::before, .frame-corners:hover::after { width: 28px; height: 28px; }

/* ---- Timecode readout ---- */
.timecode {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem; letter-spacing: 0.08em;
    color: var(--cream); opacity: 0.55;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.timecode .rec-dot {
    width: 6px; height: 6px; border-radius: 999px; background: var(--gold);
    animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---- NAV ---- */
.nav-link {
    position: relative; color: var(--cream); opacity: 0.72; font-weight: 500;
    transition: opacity .25s ease, color .25s ease; letter-spacing: 0.08em; font-size: 0.72rem;
    text-transform: uppercase; padding: 0.25rem 0; font-family: 'IBM Plex Mono', monospace;
}
.nav-link:hover { opacity: 1; }
.nav-link::before {
    content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%) scale(0);
    width: 5px; height: 5px; border-radius: 999px; background: var(--gold);
    transition: transform .25s ease;
}
.nav-link:hover::before, .nav-link.active::before { transform: translateY(-50%) scale(1); }
.nav-link.active { opacity: 1; }

.mobile-nav-link {
    display: block; padding: 0.9rem 0.5rem; font-size: 0.95rem; font-weight: 500;
    letter-spacing: 0.03em; color: var(--cream); border-bottom: 1px solid var(--cream-line);
    transition: color .2s ease, padding-left .25s ease; text-transform: uppercase;
    font-family: 'Big Shoulders Display', sans-serif;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover, .mobile-nav-link:focus, .mobile-nav-link.active { color: var(--gold); padding-left: 0.75rem; }

.hamburger {
    display: flex; flex-direction: column; gap: 5px; width: 28px; height: 24px;
    justify-content: center; align-items: center; cursor: pointer; background: transparent;
    border: none; padding: 0; position: relative; transition: transform 0.25s ease;
}
.hamburger:hover { transform: scale(1.05); }
.hamburger span {
    display: block; width: 26px; height: 2px; background: var(--cream); border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); width: 26px; }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); width: 26px; }

#mobile-menu {
    max-height: 0; overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease, padding 0.35s ease;
    opacity: 0; padding: 0 1.5rem; background: var(--navy); border-top: 1px solid transparent;
}
#mobile-menu.open { max-height: 640px; opacity: 1; padding: 0.5rem 1.5rem 1.25rem; border-top-color: var(--cream-line); }
#mobile-menu .menu-inner { opacity: 0; transform: translateY(-8px); transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s; }
#mobile-menu.open .menu-inner { opacity: 1; transform: translateY(0); }

/* ---- BUTTONS ---- */
.btn-primary {
    background: var(--gold); color: var(--cream); font-family: 'Sora', sans-serif; font-weight: 600;
    transition: transform .25s ease, background .25s ease;
}
.btn-primary:hover { background: #c93c22; transform: translateY(-2px); }

.btn-outline {
    border: 1.5px solid currentColor; font-family: 'Sora', sans-serif; font-weight: 600;
    transition: all .25s ease;
}
.btn-outline:hover { background: currentColor; transform: translateY(-2px); }
.btn-outline.on-dark { color: var(--cream); }
.btn-outline.on-dark:hover { color: var(--navy); }
.btn-outline.on-paper { color: var(--navy); }
.btn-outline.on-paper:hover { color: var(--cream); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Cards (also used by JS-generated project/documentary cards) ---- */
.card {
    background: var(--cream); border: 1px solid var(--hair);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px -22px rgba(11, 9, 6, 0.35); border-color: var(--gold); }

::selection { background: var(--gold); color: var(--cream); }

/* ---- LOGO ---- */
.logo-mark {
    filter: brightness(0) saturate(100%) invert(93%) sepia(9%) saturate(430%) hue-rotate(1deg) brightness(103%);
    transition: filter 0.3s ease, transform 0.3s ease;
    flex-shrink: 0; display: block; width: auto; height: 70px;
}
.logo-mark:hover { transform: scale(1.03); }
@media (min-width: 480px) { .logo-mark { height: 78px; } }
@media (min-width: 640px) { .logo-mark { height: 92px; } }
@media (min-width: 768px) { .logo-mark { height: 104px; } }
@media (min-width: 1024px) { .logo-mark { height: 118px; } }

.logo-link { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

header { transition: box-shadow 0.3s ease, background 0.3s ease; }
header.scrolled { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3); }

/* Explicit opaque fill for the fixed nav — the Tailwind bg-[--navy]/92
   utility (CSS var + opacity modifier) doesn't reliably resolve on the
   CDN build, which left the header see-through over light sections and
   made the cream logo/nav text unreadable. This guarantees the header
   always has its dark backing, everywhere on the site. */
#site-header { background: rgba(23, 20, 15, 0.94); }

@media (min-width: 1024px) { .desktop-nav { gap: 1.75rem; } }
@media (min-width: 1280px) { .desktop-nav { gap: 2.5rem; } }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

input:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--gold); outline-offset: 3px;
}

/* ---- Search bar (community.html / film-documentary.html / podcast.html) ---- */
.search-bar {
    position: relative; display: flex; align-items: center;
    background: var(--cream); border: 1px solid var(--hair); border-radius: 2px;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-bar svg { flex-shrink: 0; color: var(--muted); }
.search-input {
    flex: 1; background: transparent; border: none; outline: none;
    font-family: 'Sora', sans-serif; font-size: 0.95rem; color: var(--ink);
    padding: 0.85rem 0.75rem; min-width: 0;
}
.search-input::placeholder { color: var(--muted); opacity: 0.8; }
.search-clear {
    flex-shrink: 0; background: none; border: none; color: var(--muted); cursor: pointer;
    padding: 0.5rem 0.9rem 0.5rem 0.25rem; font-size: 1.1rem; line-height: 1; display: none;
}
.search-clear:hover { color: var(--gold); }
.search-bar.has-value .search-clear { display: block; }
.search-count { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }

/* ---- Badges (ongoing / completed — used by community.html JS) ---- */
.badge-ongoing { background: var(--gold-soft); color: var(--gold); }
.badge-completed { background: rgba(23, 20, 15, 0.08); color: var(--navy); }

.spinner {
    width: 22px; height: 22px; border: 2.5px solid var(--hair); border-top-color: var(--gold);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Compact project card (community.html) ---- */
.proj-card { display: flex; flex-direction: column; }
.proj-carousel { position: relative; aspect-ratio: 4 / 3; background: var(--navy); overflow: hidden; }
.proj-carousel .track { display: flex; height: 100%; transition: transform .5s cubic-bezier(0.65,0,0.35,1); }
.proj-carousel .track img { width: 100%; height: 100%; object-fit: cover; flex: 0 0 100%; }
.proj-carousel .arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
    border-radius: 999px; background: rgba(11,9,6,0.55); color: #fff; display: flex;
    align-items: center; justify-content: center; font-size: 14px; border: none; cursor: pointer;
    opacity: 0; transition: opacity .25s ease, background .25s ease; z-index: 2;
}
.proj-carousel:hover .arrow { opacity: 1; }
.proj-carousel .arrow:hover { background: var(--gold); }
.proj-carousel .arrow.prev { left: 8px; }
.proj-carousel .arrow.next { right: 8px; }
.proj-carousel .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; z-index: 2; }
.proj-carousel .dot {
    width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.5);
    border: none; padding: 0; cursor: pointer; transition: background .25s ease, width .25s ease;
}
.proj-carousel .dot.active { background: var(--gold); width: 16px; }

.proj-card .body, .doc-card .body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.proj-card .details-btn, .doc-card .details-btn {
    align-self: flex-start; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 2px;
    padding: 0.45rem 0.9rem; transition: all .25s ease; margin-top: auto; font-family: 'IBM Plex Mono', monospace;
}
.proj-card .details-btn:hover, .doc-card .details-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--cream); }

/* ---- Documentary card (film-documentary.html) ---- */
.doc-card { display: flex; flex-direction: column; }
.doc-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.85); }
.doc-thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.doc-thumb .play span {
    width: 46px; height: 46px; border-radius: 999px; background: rgba(11,9,6,0.55);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
    transition: background .25s ease, transform .25s ease; border: 1.5px solid rgba(244,238,223,0.4);
}
.doc-card:hover .doc-thumb .play span { background: var(--gold); border-color: var(--gold); transform: scale(1.08); }

.badge-pill { font-family: 'IBM Plex Mono', monospace; }

/* ---- Episode row (podcast.html) ---- */
.ep-card {
    display: flex; align-items: center; gap: 1rem; background: var(--cream);
    border: 1px solid var(--hair); border-radius: 2px; padding: 1.1rem 1.25rem;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ep-card:hover { transform: translateX(4px); box-shadow: 0 14px 30px -18px rgba(11,9,6,0.3); border-color: var(--gold); }
.ep-play {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; background: var(--navy);
    display: flex; align-items: center; justify-content: center; transition: background .25s ease, transform .25s ease;
}
.ep-card:hover .ep-play { background: var(--gold); transform: scale(1.06); }
.ep-play svg { display: block; }
.ep-num { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; flex-shrink: 0; width: 3rem; }
.ep-info { flex: 1; min-width: 0; }
.ep-title { font-weight: 600; color: var(--ink); font-size: 0.98rem; line-height: 1.3; }
.ep-guest { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; letter-spacing: 0.03em; }
.ep-duration { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }
@media (max-width: 640px) { .ep-num { display: none; } }

/* Whole cards are now clickable through to a detail page — arrows/dots on the
   card still stop propagation so they don't trigger navigation. */
.card[data-id] { cursor: pointer; }
.details-btn { text-decoration: none; }

/* ============================================================
   DETAIL PAGES — single project / documentary "screening room"
   ============================================================ */

.detail-backlink {
    display: inline-flex; align-items: center; gap: 0.55rem; font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream); opacity: 0.7;
    transition: opacity .2s ease, gap .2s ease; text-decoration: none;
}
.detail-backlink:hover { opacity: 1; gap: 0.85rem; }
.detail-backlink .arrow-glyph { transition: transform .2s ease; }
.detail-backlink:hover .arrow-glyph { transform: translateX(-3px); }

/* ---- Hero gallery (community project detail) ---- */
.detail-hero { position: relative; height: 62vh; min-height: 380px; max-height: 680px; background: var(--navy); overflow: hidden; margin-top: 5rem; }
@media (min-width: 640px) { .detail-hero { margin-top: 6rem; } }
@media (min-width: 1024px) { .detail-hero { margin-top: 7rem; } }
.detail-gallery { position: absolute; inset: 0; }
.detail-gallery .track { display: flex; height: 100%; transition: transform .6s cubic-bezier(0.65,0,0.35,1); }
.detail-gallery .track img { width: 100%; height: 100%; object-fit: cover; flex: 0 0 100%; }
.detail-gallery .arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px;
    border-radius: 999px; background: rgba(11,9,6,0.5); color: #fff; display: flex;
    align-items: center; justify-content: center; font-size: 20px; border: 1px solid rgba(244,238,223,0.25);
    cursor: pointer; transition: background .25s ease, border-color .25s ease; z-index: 3;
}
.detail-gallery .arrow:hover { background: var(--gold); border-color: var(--gold); }
.detail-gallery .arrow.prev { left: 18px; } .detail-gallery .arrow.next { right: 18px; }
.detail-gallery .dots { position: absolute; bottom: 20px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 3; }
.detail-gallery .dot {
    width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,0.5);
    border: none; padding: 0; cursor: pointer; transition: background .25s ease, width .25s ease;
}
.detail-gallery .dot.active { background: var(--gold); width: 22px; }
.detail-gallery-count {
    position: absolute; top: 18px; right: 18px; z-index: 3; font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem; letter-spacing: 0.08em; color: var(--cream); background: rgba(11,9,6,0.5);
    border: 1px solid rgba(244,238,223,0.25); border-radius: 2px; padding: 0.25rem 0.55rem;
}

.detail-hero-topbar {
    position: absolute; inset: 0 0 auto 0; z-index: 4; pointer-events: none;
    background: linear-gradient(to bottom, rgba(11,9,6,0.75) 0%, rgba(11,9,6,0) 100%);
    padding-top: 1.5rem; padding-bottom: 2.5rem;
}
.detail-hero-topbar > * { pointer-events: auto; }

.detail-hero-content {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(to top, rgba(11,9,6,0.96) 0%, rgba(11,9,6,0.55) 48%, rgba(11,9,6,0) 82%);
    z-index: 2; pointer-events: none;
}
.detail-hero-content > * { pointer-events: auto; }

/* ---- Meta row (status / type mono pills) ---- */
.detail-meta-pill {
    font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.4rem 0.75rem; border: 1px solid var(--cream-line); border-radius: 999px; color: var(--cream); opacity: 0.85;
}

/* ---- Related grid: simplified variant of the card system ---- */
.related-card { display: flex; flex-direction: column; text-decoration: none; }
.related-card .thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--navy); }
.related-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.related-card:hover .thumb img { transform: scale(1.06); }
.related-card .body { padding: 1rem 1.1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.related-card .view-glyph { color: var(--gold); font-size: 1.1rem; transition: transform .25s ease; }
.related-card:hover .view-glyph { transform: translateX(4px); }

/* ---- Screening-room video frame (documentary detail) ---- */
.screening-frame { position: relative; background: #000; box-shadow: 0 30px 70px -30px rgba(0,0,0,0.7); }

@media (prefers-reduced-motion: reduce) {
    .reveal, .btn-primary, .btn-outline, .card, .nav-link::before, #mobile-menu, .hamburger span, .mobile-nav-link, .spinner,
    .proj-carousel .track, .frame-corners::before, .frame-corners::after, .timecode .rec-dot,
    .detail-gallery .track, .detail-backlink, .related-card .thumb img {
        transition: none !important; animation: none !important;
    }
}
