/* ==========================================================================
   components.css — nav, buttons, cursor, cards, filters, lightbox, forms
   ========================================================================== */

/* Navigation -------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 1000; height: var(--nav-h);
  transition: background 0.4s, backdrop-filter 0.4s, transform 0.5s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(7, 7, 11, 0.7); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-color: var(--line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; }
.logo__mark {
  width: 26px; height: 26px; border-radius: 8px 50% 8px 50%;
  background: var(--grad); background-size: 200% 200%; animation: gradShift 6s linear infinite;
  transition: transform 0.6s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(180deg) scale(1.1); }
.nav__links { display: flex; gap: 6px; margin-left: auto; }
.nav__links a {
  position: relative; padding: 8px 14px; font-size: 0.95rem; color: var(--muted); transition: color 0.3s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.4s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__toggle { display: none; width: 44px; height: 44px; position: relative; margin-left: auto; z-index: 2; }
.nav__toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.nav__toggle span:first-child { top: 18px; }
.nav__toggle span:last-child { top: 26px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

@media (max-width: 880px) {
  .nav__toggle { display: block; }
  .nav .nav__cta { display: none; }
  .nav__links {
    position: fixed; inset: 0; margin: 0; flex-direction: column; justify-content: center; align-items: center; gap: 12px;
    background: rgba(7, 7, 11, 0.97); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
  }
  .nav__links a { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--text); }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
}

/* Buttons ------------------------------------------------------------------ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; overflow: hidden;
  border: 1px solid var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s, border-color 0.3s, background 0.3s;
  isolation: isolate; will-change: transform;
}
.btn--small { padding: 10px 20px; font-size: 0.85rem; }
.btn--large { padding: 20px 44px; font-size: 1.05rem; }
.btn--primary { background: var(--grad); background-size: 200% 100%; border-color: transparent; color: #fff; box-shadow: 0 10px 40px -10px rgba(236, 72, 153, 0.6); }
.btn--primary:hover { background-position: 100% 0; box-shadow: 0 16px 50px -8px rgba(236, 72, 153, 0.8); transform: translateY(-2px); }
.btn--ghost { background: rgba(255, 255, 255, 0.03); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }
.nav__cta { background: rgba(255, 255, 255, 0.04); }
.nav__cta:hover { background: var(--text); color: var(--bg); }
.link-arrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: gap 0.3s var(--ease), border-color 0.3s; }
.link-arrow:hover { gap: 16px; border-color: var(--pink); }

/* Custom cursor ------------------------------------------------------------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor-on, .cursor-on a, .cursor-on button, .cursor-on summary, .cursor-on select { cursor: none; }
  .cursor-on .cursor { display: block; }
  .cursor { position: fixed; inset: 0 auto auto 0; z-index: 2000; pointer-events: none; mix-blend-mode: normal; }
  .cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; pointer-events: none; will-change: transform; }
  .cursor__dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; transition: opacity 0.3s; }
  .cursor__ring {
    width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    display: grid; place-items: center;
    transition: width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease), background 0.3s, border-color 0.3s, opacity 0.3s;
  }
  .cursor__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0; transition: opacity 0.25s; color: #fff; }
  .cursor.is-hover .cursor__ring { width: 68px; height: 68px; margin: -34px 0 0 -34px; background: rgba(236, 72, 153, 0.18); border-color: var(--pink); }
  .cursor.is-hover .cursor__dot { opacity: 0; }
  .cursor.is-view .cursor__ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--grad); border-color: transparent; }
  .cursor.is-view .cursor__dot { opacity: 0; }
  .cursor.is-view .cursor__label, .cursor.has-label .cursor__label { opacity: 1; }
  .cursor.is-down .cursor__ring { transform-origin: center; scale: 0.85; }
  .cursor.is-hidden { opacity: 0; }
  .cursor-trail { position: fixed; top: 0; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none; z-index: 1999; background: var(--grad); filter: blur(6px); opacity: 0.5; will-change: transform; }
}

/* Portfolio filters ---------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }
.filter {
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.9rem; font-weight: 500; color: var(--muted);
  transition: color 0.3s, background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.filter sup { font-size: 0.65rem; opacity: 0.6; margin-left: 2px; }
.filter:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.filter.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* Cards / gallery -------------------------------------------------------------- */
.masonry { column-count: 3; column-gap: 28px; }
.masonry > * { break-inside: avoid; margin-bottom: 28px; }
@media (max-width: 1000px) { .masonry { column-count: 2; } }
@media (max-width: 600px) { .masonry { column-count: 1; } }

.card { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.card.is-filtered-out { opacity: 0; transform: scale(0.92); pointer-events: none; }
.card.is-gone { display: none; }
.card__link { display: block; width: 100%; text-align: left; }
.card__media {
  position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: var(--ratio, 4/5);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.7s var(--ease), box-shadow 0.7s;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.card__media::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7, 7, 11, 0.55));
  opacity: 0; transition: opacity 0.5s;
}
.card__link:hover .card__media, .card__link:focus-visible .card__media { transform: translateY(-6px); box-shadow: 0 30px 60px -20px rgba(124, 58, 237, 0.45); }
.card__link:hover .card__media img { transform: scale(1.08); }
.card__link:hover .card__media::after { opacity: 1; }
.card__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 4px 0; }
.card__title { font-size: 1.2rem; font-weight: 700; }
.card__cat { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.card__year { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; padding-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Lightbox ------------------------------------------------------------------------ */
.lightbox { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox[hidden] { display: none; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(4, 4, 8, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lightbox__panel {
  position: relative; width: min(1180px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-columns: 1.5fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  transform: translateY(30px) scale(0.96); transition: transform 0.6s var(--ease);
}
.lightbox.is-open .lightbox__panel { transform: none; }
.lightbox__figure { background: #05050a; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.lightbox__figure img { width: 100%; height: 100%; max-height: calc(100vh - 48px); object-fit: contain; transition: opacity 0.35s, transform 0.5s var(--ease); }
.lightbox__figure img.is-swapping { opacity: 0; transform: scale(1.03); }
.lightbox__info { padding: clamp(24px, 3.5vw, 48px); display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.lightbox__title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; }
.lightbox__desc { color: var(--muted); }
.lightbox__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 0; border-block: 1px solid var(--line); }
.lightbox__facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.lightbox__facts dd { font-weight: 600; margin-top: 2px; }
.lightbox__count { margin-top: auto; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.lightbox__btn {
  position: absolute; z-index: 3; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); backdrop-filter: blur(10px);
  transition: background 0.3s, transform 0.3s var(--ease);
}
.lightbox__btn:hover { background: var(--pink); transform: scale(1.08); }
.lightbox__close { top: 20px; right: 20px; font-size: 1.8rem; line-height: 1; }
.lightbox__nav { top: 50%; margin-top: -26px; }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 0.8rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
body.no-scroll { overflow: hidden; }

@media (max-width: 860px) {
  .lightbox { padding: 0; align-items: end; }
  .lightbox__panel { grid-template-columns: 1fr; border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto; }
  .lightbox__figure img { max-height: 45vh; }
  .lightbox__nav { top: 22vh; }
  .lightbox__prev { left: 12px; } .lightbox__next { right: 12px; }
  .lightbox__close { top: 12px; right: 12px; }
}

/* Forms --------------------------------------------------------------------------- */
.form { display: grid; gap: 22px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; padding: 26px 20px 12px; background: var(--surface); color: var(--text); font: inherit;
  border: 1px solid var(--line); border-radius: 14px; outline: none; transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field--select select { padding: 20px; appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 24px) 50%, calc(100% - 18px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--surface-2); }
.field label { position: absolute; left: 21px; top: 20px; color: var(--muted); pointer-events: none; transition: transform 0.3s var(--ease), color 0.3s; transform-origin: 0 0; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-12px) scale(0.75); color: var(--cyan); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2); background: var(--surface-2); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #f43f5e; }
.field__error { color: #fb7185; font-size: 0.84rem; min-height: 0; margin-top: 6px; }
.field__error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__submit { justify-self: start; }
.btn__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.form.is-loading .btn__spinner { display: block; }
.form.is-loading .form__submit { pointer-events: none; opacity: 0.8; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 16px 20px; border-radius: 14px; margin-bottom: 24px; border: 1px solid; }
.alert--success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.4); color: #6ee7b7; }
.form-success { text-align: center; padding: 60px 20px; animation: pop 0.7s var(--ease); }
.form-success[hidden] { display: none; }
.form-success__icon { width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; background: var(--grad); box-shadow: 0 20px 60px -10px rgba(236, 72, 153, 0.6); }
.form-success h3 { font-size: 2rem; margin-bottom: 8px; }
.form-success p { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: scale(0.9) translateY(20px); } }
