/* =========================================================================
   bernardz.com — dark & sleek portfolio theme
   Hand-written, no build step (works on Node-less shared hosting).
   ========================================================================= */

:root {
    --bg:        #0b0b0d;
    --bg-soft:   #121214;
    --surface:   #17171b;
    --surface-2: #1e1e23;
    --border:    rgba(255, 255, 255, 0.08);
    --border-2:  rgba(255, 255, 255, 0.14);
    --text:      #ececf1;
    --muted:     #9a9aa6;
    --accent:    #f2055c;
    --accent-2:  #ff3d80;
    --maxw:      1180px;
    --radius:    16px;
    --ease:      cubic-bezier(0.22, 1, 0.36, 1);
    --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Preloader (B . → Bernard.) ---------- */
.preloader {
    position: fixed; inset: 0; z-index: 9999; background: var(--bg);
    display: grid; place-items: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__mark {
    display: flex; align-items: baseline;
    font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em;
    font-size: clamp(2.6rem, 9vw, 5.5rem); color: var(--text);
}
/* "B" and "." blink slowly a few times, then the middle expands to "Bernard." */
.preloader__mark .pm-b   { animation: pmBlink 1.2s ease-in-out 3; }
.preloader__mark .pm-dot { color: var(--accent); animation: pmBlink 1.2s ease-in-out 3; }
.preloader__mark .pm-mid { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; animation: pmMid 0.7s var(--ease) 3.7s forwards; }
@keyframes pmBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.12; } }
@keyframes pmMid   { to { opacity: 1; max-width: 7ch; } }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; margin: 0; }

.eyebrow {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 18px;
}

.section { padding: clamp(72px, 11vw, 150px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--border); }
.section__title { font-size: clamp(2.1rem, 6vw, 4rem); letter-spacing: -0.02em; margin-bottom: 14px; }
.section__lead { color: var(--muted); max-width: 620px; font-size: 1.05rem; }

/* ---------- Navigation ---------- */
.nav {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(11, 11, 13, 0.72);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.nav__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 96px;
}
.nav__brand { font-family: var(--font-head); font-weight: 700; font-size: 2.25rem; letter-spacing: -0.01em; }
.nav__brand span { color: var(--accent); }
.nav__links { display: flex; gap: 40px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav__links a {
    font-family: var(--font-head); font-weight: 600;
    font-size: 1.7rem; color: var(--text); position: relative; padding: 6px 0;
    transition: color 0.25s var(--ease);
}
.nav__links a::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
    background: var(--accent); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--accent); }
.nav__links a:hover::after { width: 100%; }
.nav__toggle {
    display: none; background: none; border: 0; cursor: pointer;
    width: 44px; height: 44px; padding: 0; margin: 0;
    align-items: center; justify-content: flex-end;
}
.nav__burger, .nav__burger::before, .nav__burger::after {
    display: block; width: 26px; height: 2.5px; border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s var(--ease), background 0.2s var(--ease);
}
.nav__burger { position: relative; }
.nav__burger::before, .nav__burger::after { content: ""; position: absolute; left: 0; }
.nav__burger::before { top: -8px; }
.nav__burger::after { top: 8px; }
.nav__toggle[aria-expanded="true"] .nav__burger { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__burger::before { transform: translateY(8px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__burger::after { transform: translateY(-8px) rotate(-45deg); }
/* Legibility over the hero image while the nav background is still transparent */
.nav:not(.scrolled) .nav__brand,
.nav:not(.scrolled) .nav__links a,
.nav:not(.scrolled) .nav__toggle { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.6); }

/* ---------- Hero ---------- */
.hero {
    position: relative; min-height: 100svh; display: flex; align-items: flex-end;
    padding-bottom: clamp(60px, 9vw, 110px); overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
    filter: grayscale(100%) contrast(1.05);
}
.hero__overlay {
    position: absolute; inset: 0; z-index: 1;
    background:
        linear-gradient(180deg, rgba(11,11,13,0.55) 0%, rgba(11,11,13,0.15) 35%, rgba(11,11,13,0.75) 78%, var(--bg) 100%),
        radial-gradient(120% 80% at 80% 10%, rgba(242,5,92,0.13), transparent 60%);
}
.hero__content { position: relative; z-index: 2; width: 100%; will-change: transform, opacity; }
.hero__title {
    font-size: clamp(2.8rem, 11vw, 8rem);
    letter-spacing: -0.035em; line-height: 0.95; margin-bottom: 22px;
}
.hero__subtitle {
    display: inline-flex; align-items: center; gap: 14px;
    font-family: var(--font-head); font-size: clamp(1rem, 2.4vw, 1.45rem);
    color: var(--text); letter-spacing: 0.02em;
}
.hero__subtitle::before { content: ""; width: 46px; height: 1.5px; background: var(--accent); }
/* Subtitle now nested inside the H1 for SEO; keep the old stacked layout. */
.hero__title .hero__subtitle { display: flex; margin-top: 22px; font-weight: normal; }
.hero__scroll {
    position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2;
    color: var(--muted); font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll i { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); animation: scrollPulse 1.8s var(--ease) infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 26px; margin-top: 56px; }
.about-card {
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 38px 34px; transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.about-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.about-card h3 {
    font-size: 1.5rem; margin-bottom: 18px; display: flex; align-items: center; gap: 12px;
}
.about-card h3::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.about-card p { color: var(--muted); margin: 0; text-align: justify; hyphens: auto; }

/* ---------- Works ---------- */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 26px; margin-top: 56px; }
.work-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.work-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: 0 24px 50px -24px rgba(0,0,0,0.7); }
.work-card__media { position: relative; aspect-ratio: 16 / 10; background: #000; }
.work-card__media video, .work-card__media img { width: 100%; height: 100%; object-fit: cover; }
.work-card__media--audio {
    display: flex; align-items: center; justify-content: center; padding: 26px;
    background: radial-gradient(130% 130% at 50% 0%, var(--surface-2), #0c0c0e);
}
.work-card__media--audio .work-card__art {
    position: absolute; inset: 0; object-fit: cover; opacity: 0.22;
}
.work-card__body { padding: 22px 24px 26px; }
.work-card__badge {
    display: inline-block; font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--accent); border: 1px solid var(--border-2);
    border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.work-card__title { font-size: 1.2rem; line-height: 1.25; margin-bottom: 10px; }
.work-card__caption { color: var(--muted); font-size: 0.94rem; margin: 0; }

/* ---------- Audio player (SoundCloud-style) ---------- */
.player {
    position: relative; z-index: 1; width: 100%;
    display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center;
}
.player__btn {
    grid-column: 1; grid-row: 1; width: 54px; height: 54px; border-radius: 50%; border: 0;
    background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease);
    box-shadow: 0 10px 28px -10px rgba(242, 5, 92, 0.65);
}
.player__btn:hover { transform: scale(1.07); background: var(--accent-2); }
.player__btn svg { width: 22px; height: 22px; fill: currentColor; }
.player__wave {
    grid-column: 2; grid-row: 1; min-width: 0;
    display: flex; align-items: center; gap: 3px; height: 56px; cursor: pointer;
    padding-right: 12px;
}
.player__bar {
    flex: 1 1 0; min-width: 2px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.18); transition: background 0.12s linear;
}
.player__bar.played { background: var(--accent); }
.player__meta {
    grid-column: 2; grid-row: 2; padding-right: 12px;
    display: flex; justify-content: space-between; margin-top: 10px;
    font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums;
    font-family: var(--font-head);
}

/* ---------- Gallery ---------- */
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 22px; margin-top: 56px;
}
.gallery-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-card:hover {
    transform: scale(1.04); border-color: var(--border-2);
    box-shadow: 0 22px 46px -24px rgba(0, 0, 0, 0.7); z-index: 1;
}
.gallery-card__img { aspect-ratio: 3 / 4; background: #000; }
.gallery-card__img img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card__body { padding: 16px 18px 18px; }
.gallery-card__label {
    display: inline-block; font-family: var(--font-head); font-size: 0.62rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--accent); border: 1px solid var(--border-2);
    border-radius: 999px; padding: 3px 10px; margin-bottom: 10px;
}
.gallery-card__title { font-size: 1.05rem; line-height: 1.2; margin-bottom: 3px; }
.gallery-card__role {
    margin: 0 0 6px; font-family: var(--font-head); font-size: 0.85rem;
    color: var(--accent); font-style: italic;
}
.gallery-card__meta { color: var(--muted); font-size: 0.82rem; }
.gallery-card__meta .sep { color: var(--border-2); margin: 0 6px; }
.gallery-card__credit {
    margin: 6px 0 0; font-size: 0.68rem; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--muted); opacity: 0.7;
    font-family: var(--font-head);
}

/* ---------- Testimonials ---------- */
.testimonials { margin-top: 0; }
.t-viewport { overflow: hidden; }
.t-track { display: flex; transition: transform 0.6s var(--ease); }
.t-slide { min-width: 100%; padding: 8px 4px; }
.t-quote {
    font-family: var(--font-head); font-size: clamp(1.4rem, 3.4vw, 2.2rem); line-height: 1.4;
    font-weight: 500; letter-spacing: -0.01em; max-width: 880px; margin: 0 auto 26px; text-align: center;
}
.t-quote::before { content: "\201C"; color: var(--accent); margin-right: 4px; }
.t-quote::after { content: "\201D"; color: var(--accent); margin-left: 4px; }
.t-cite { display: block; text-align: center; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.04em; }
.t-cite strong { color: var(--text); font-weight: 600; }
.t-controls { display: flex; gap: 12px; justify-content: center; margin-top: 40px; }
.t-btn {
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-2);
    background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.t-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.t-dots { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }
.t-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); border: 0; padding: 0; cursor: pointer; transition: all 0.3s var(--ease); }
.t-dot.active { background: var(--accent); width: 22px; border-radius: 999px; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 56px; align-items: start; }
.contact__form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.82rem; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; font-family: var(--font-head); }
.field input, .field textarea {
    width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); font-family: var(--font-body); font-size: 1rem; padding: 14px 16px;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); background: var(--surface-2); }
.field--error input, .field--error textarea { border-color: #f0726a; }
.field__error { color: #f0726a; font-size: 0.85rem; }
/* honeypot — visually hidden, off-screen, not display:none (some bots skip hidden) */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
    font-family: var(--font-head); font-weight: 600; font-size: 1rem; letter-spacing: 0.01em;
    padding: 15px 30px; border-radius: 999px; border: 1px solid var(--accent);
    background: var(--accent); color: #fff; cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--accent-2); box-shadow: 0 14px 34px -12px rgba(242, 5, 92, 0.6); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }
.btn__spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
    display: inline-block; animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

.contact__aside h3 { font-size: 1.4rem; margin-bottom: 8px; }
.contact__aside p { color: var(--muted); }
.contact__direct { margin-top: 30px; }
.contact__direct a { color: var(--accent); font-family: var(--font-head); font-size: 1.15rem; }

.alert { border-radius: 12px; padding: 16px 18px; font-size: 0.95rem; }
.alert--success { background: rgba(110, 231, 183, 0.1); border: 1px solid rgba(110,231,183,0.35); color: #9af0cf; }
.alert--error { background: rgba(240,114,106,0.1); border: 1px solid rgba(240,114,106,0.35); color: #f4a39d; }

/* ---------- Footer ---------- */
.footer { padding: clamp(72px, 10vw, 130px) 0 50px; border-top: 1px solid var(--border); }
.footer__cta { font-size: clamp(1.6rem, 4.5vw, 3rem); letter-spacing: -0.02em; max-width: 760px; margin-bottom: 60px; }
.footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer__col h4 { font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.link-list a { color: var(--text); transition: color 0.25s var(--ease); }
.link-list a:hover { color: var(--accent); }
.footer__bottom {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
    margin-top: 70px; padding-top: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem;
}
.footer__top-link { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.footer__top-link:hover { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal {
    opacity: 0; transform: translateY(34px) scale(0.985);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    /* tighter nav + anchor offset so jumped-to sections sit just under the bar */
    html { scroll-padding-top: 44px; }
    .nav__inner { height: 72px; }
    .nav__toggle { display: flex; }
    .nav__links {
        position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
        background: rgba(11,11,13,0.96); backdrop-filter: blur(14px);
        /* border only when open — a border on the collapsed (max-height: 0)
           panel still paints as a stray line under the header */
        border-bottom: 0;
        max-height: 0; overflow: hidden; transition: max-height 0.45s var(--ease);
    }
    .nav__links.open { max-height: 70vh; border-bottom: 1px solid var(--border); }
    .nav__links li { width: 100%; text-align: center; border-top: 1px solid var(--border); }
    .nav__links a { display: block; padding: 18px 0; font-size: 1.4rem; }
    .nav__brand { font-size: 1.9rem; }
    .section { padding: 56px 0; }
    .contact__grid { grid-template-columns: 1fr; gap: 40px; }
    .footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .footer__cols { grid-template-columns: 1fr; }
    body { font-size: 16px; }
    /* give the subtitle and the scroll cue breathing room */
    .hero { padding-bottom: 96px; }
    .hero__scroll { bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
    .hero__content { transform: none !important; opacity: 1 !important; }
    /* Show the full wordmark instantly instead of relying on the reveal animation */
    .preloader__mark .pm-b,
    .preloader__mark .pm-dot,
    .preloader__mark .pm-mid { opacity: 1 !important; transform: none !important; max-width: 7ch !important; }
}
