/* ============================================
   TIM COLLINS STUDIO — tc.css
   ============================================ */

/* --- Karrik --- */
@font-face {
    font-family: "Karrik";
    src: url("../fonts/Karrik-Regular.woff2") format("woff2"),
         url("../fonts/Karrik-Regular.woff") format("woff");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Karrik";
    src: url("../fonts/Karrik-Italic.woff2") format("woff2"),
         url("../fonts/Karrik-Italic.woff") format("woff");
    font-weight: 400; font-style: italic; font-display: swap;
}

/* --- Director --- */
@font-face {
    font-family: "Director";
    src: url("../fonts/Director-Light.woff2") format("woff2"),
         url("../fonts/Director-Light.woff") format("woff");
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Director";
    src: url("../fonts/Director-Regular.woff2") format("woff2"),
         url("../fonts/Director-Regular.woff") format("woff");
    font-weight: 400; font-style: normal; font-display: swap;
}

/* --- Tokens --- */
:root {
    --bg:           #ffffff;
    --text:         #000000;
    --caption:      #999999;
    --border:       rgba(0,0,0,0.1);
    --accent:       #FFFF00;
    --nav-width:    580px;
    --header-h:     72px;
    --font-display: 'Karrik', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-body:    'Director', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --pad-h:        5vw;
}

[data-theme="dark"] {
    --bg: #000000; --text: #ffffff;
    --caption: #666666; --border: rgba(255,255,255,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-display);
    background: var(--bg); color: var(--text);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Hide system cursor — circle cursor handles it */
body, a, button, input, [role="button"] { cursor: none !important; }
#nav-panel, #nav-panel * { cursor: none !important; }

/* ============================================
   CIRCLE CURSOR
   ============================================ */

#cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 11px;
    height: 11px;
    background: var(--text);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
        width  0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.2s ease,
        opacity 0.2s ease;
    opacity: 0;
    will-change: left, top;
}
#cursor.visible  { opacity: 1; }
#cursor.on-link  { width: 22px; height: 22px; }
#cursor.on-image { width: 34px; height: 34px; background: var(--accent); }
/* Hide inside the gallery stage — arrow cursors take over */
#cursor.in-zone  { opacity: 0 !important; }

/* ============================================
   HEADER
   ============================================ */

#header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100; height: var(--header-h);
    background: var(--bg); padding: 0 var(--pad-h);
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.3s;
}

.site-name {
    font-family: var(--font-display);
    font-size: 2.2rem; font-weight: 400;
    letter-spacing: -0.02em; line-height: 1;
    color: var(--text); transition: color 0.3s;
}

.nav-trigger {
    appearance: none; -webkit-appearance: none;
    background: none; border: none; outline: none; padding: 0; margin: 0;
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text); transition: color 0.3s;
}

/* ============================================
   MAIN + STAGE
   ============================================ */

#main {
    padding-top: var(--header-h);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--pad-h);
    overflow: hidden;
}

#gallery-wrap {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
}

#gallery-frame {
    width: 100%;
    height: 68vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gallery-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.18s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* ============================================
   GALLERY FOOTER (caption + counter, below image)
   ============================================ */

#gallery-footer { display: none; }

#gallery-counter {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--caption);
    letter-spacing: 0.04em;
    transition: color 0.3s;
}

/* Unused — hidden */
#gallery-series-label,
#gallery-caption,
#gallery-meta { display: none; }

/* ============================================
   GALLERY ARROW CURSORS
   (follow mouse, mutually exclusive with circle cursor)
   ============================================ */

.gallery-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 50;
    display: none;
    align-items: center;
    gap: 0;
    transform: translateY(-50%);
}
.gallery-cursor.active { display: flex; }

.gc-line {
    width: 55px; height: 1px;
    background: var(--text); flex-shrink: 0;
    transition: background 0.3s;
}
.gc-head-l {
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 9px solid var(--text);
    flex-shrink: 0;
    transition: border-color 0.3s;
}
.gc-head-r {
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 9px solid var(--text);
    flex-shrink: 0;
    transition: border-color 0.3s;
}

/* ============================================
   SERIES TRANSITION OVERLAY
   ============================================ */

#transition-overlay {
    position: fixed; inset: 0;
    background: #000;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 6vw 9vh 8vw;
    opacity: 0; pointer-events: none;
    transition: opacity 0.55s ease;
    overflow: hidden;
}
[data-theme="dark"] #transition-overlay {
    background: #fff;
}
#transition-overlay.active {
    opacity: 1; pointer-events: all;
}
#transition-overlay.cut {
    transition: none;
}

#transition-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 11vw, 13rem);
    color: #fff;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 0.88;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}
[data-theme="dark"] #transition-title {
    color: #000;
}
#transition-title.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   FOOTER
   ============================================ */

#footer {
    padding: 0 var(--pad-h) 28px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.footer-copy {
    font-family: var(--font-body); font-weight: 300;
    font-size: 0.7rem; letter-spacing: 0.04em;
    color: var(--caption);
    transition: color 0.3s;
}

/* ============================================
   NAVIGATION PANEL
   ============================================ */

#nav-backdrop {
    position: fixed; inset: 0;
    z-index: 150;
    background: transparent;
    display: none;
}
#nav-backdrop.active { display: block; }

#nav-panel {
    position: fixed; top: 0;
    right: calc(-1 * var(--nav-width) - 80px);
    width: var(--nav-width); height: 100vh;
    height: 100dvh;
    background: var(--bg); z-index: 200;
    padding: 50px 60px;
    display: flex; flex-direction: column;
    box-shadow: -20px 0 60px rgba(0,0,0,0.06);
    transition: right 0.45s cubic-bezier(0.4,0,0.2,1), background 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#nav-panel.open { right: 0; }

.nav-close {
    position: absolute; top: 28px; right: 40px;
    font-size: 1.8rem; line-height: 1;
    appearance: none; -webkit-appearance: none;
    background: none; border: none; outline: none;
    color: var(--text); font-family: var(--font-display);
    transition: opacity 0.15s; padding: 4px;
}
.nav-close:hover { opacity: 0.4; }

/* Series groups — Davison-style clusters with gaps */
#nav-series-groups {
    margin-top: 40px;
    flex: 1;
}

.nav-group {
    margin-bottom: 32px;
}

/* Series link row: title left, count right */
.nav-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-display);
    font-size: 1.55rem; font-weight: 400;
    letter-spacing: -0.01em; line-height: 1.25;
    margin-bottom: 8px;
    padding: 2px 4px 2px 0;
    transition: background-color 0.15s;
    color: var(--text);
}
.nav-link:hover { background-color: var(--accent); color: #000; }

.nav-link-count {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--caption);
    flex-shrink: 0;
    margin-left: 16px;
    /* Don't invert on hover — it would disappear on yellow */
    transition: color 0.15s;
}
.nav-link:hover .nav-link-count { color: rgba(0,0,0,0.45); }

.nav-divider { height: 1px; background: var(--border); margin: 8px 0 24px; transition: background 0.3s; }

.nav-contact { padding-top: 4px; }

.nav-bio-container {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.nav-bio {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--caption);
    flex: 1;
    transition: color 0.3s;
}

.bio-thumbnail {
    width: 72px;
    height: 72px;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-contact-link {
    display: inline-block;
    font-family: var(--font-body); font-weight: 300;
    font-size: 0.78rem; margin-bottom: 6px;
    padding: 2px 4px 2px 0;
    transition: background-color 0.15s; color: var(--text);
}
.nav-contact-link:hover { background-color: var(--accent); color: #000; }

.nav-dark-toggle {
    display: flex; align-items: center; gap: 12px; margin-top: 20px;
    font-family: var(--font-body); font-weight: 300;
    font-size: 0.72rem; opacity: 0.45;
    appearance: none; -webkit-appearance: none;
    border: none; background: none; outline: none;
    color: var(--text); padding: 0; transition: opacity 0.15s;
}
.nav-dark-toggle:hover { opacity: 1; }

.toggle-track {
    width: 30px; height: 15px;
    border: 1px solid currentColor;
    border-radius: 8px; position: relative; flex-shrink: 0;
}
.toggle-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: currentColor; transition: transform 0.25s ease;
}
[data-theme="dark"] .toggle-thumb { transform: translateX(15px); }

/* ============================================
   TABLET  ≤900px
   ============================================ */

@media (max-width: 900px) {
    :root { --nav-width: 100vw; }

    .site-name  { font-size: 1.8rem; }
    #nav-panel  { right: -110%; }
}

/* ============================================
   MOBILE  ≤600px
   ============================================ */

@media (max-width: 600px) {
    :root { --header-h: 60px; }

    .site-name   { font-size: 1.5rem; }
    .nav-trigger { font-size: 0.65rem; }

    #nav-panel { padding: 50px 32px 40px; }
    .nav-link  { font-size: 1.25rem; }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */

@media (hover: none) {
    body, a, button, input { cursor: auto !important; }
    #cursor { display: none !important; }
    .gallery-cursor { display: none !important; }
}
