/* Visual language aligned with codillin' / wiciędze. */

@property --turn-x {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --turn-y {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --turn-z {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --turn-ry {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --ink: #060606;
  --gold: #c4922a;
  --gold-2: #a0522d;
  --gold-hover: #d4a535;
  --muted: #c4c4c4;
  --panel: rgba(10, 10, 10, 0.95);
  --card: #0d0d0d;
  --input: #111;
  --border: rgba(255, 255, 255, 0.08);
  --border-quiet: rgba(255, 255, 255, 0.14);
  /* Hub Poppins scale */
  --fs-nav: clamp(1.2rem, 2.9vw, 1.55rem);
  --fs-page: clamp(1.8rem, 5vw, 2.8rem);
  --fs-section: clamp(1.25rem, 2.8vw, 1.5rem);
  --fs-body: 1.05rem;
  --fs-caption: 0.875rem;
  --fs-muted: clamp(1rem, 2.2vw, 1.15rem);
  --measure: 920px;
  /* Kaushan: standalone motto / specify */
  --fs-script-tagline: clamp(1.55rem, 3.4vw, 2rem);
}

/* ── Loader ──────────────────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-border {
  border-color: var(--gold) transparent var(--gold) transparent !important;
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
  color: #e0e0e0;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  padding-top: 88px;
  min-height: 100vh;
  min-height: 100dvh;
}

.gallery-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1100;
  background: var(--gold);
  color: #fff;
  font-weight: 400;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}

.gallery-skip:focus {
  left: 0;
}

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

.navbar {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.navbar-brand,
.gallery-brand {
  font-weight: 300;
  text-transform: none;
  letter-spacing: 3px;
  color: var(--gold) !important;
  text-decoration: none;
  font-size: var(--fs-nav);
  transition: color 0.3s ease;
}

.navbar-brand:hover,
.gallery-brand:hover {
  color: var(--gold-hover) !important;
  letter-spacing: 3px;
  text-decoration: none;
}

.navbar .nav-link {
  display: flex;
  align-items: center;
  color: #e0e0e0;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  min-height: 44px;
  transition: color 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--gold) !important;
  font-weight: 300;
  text-shadow: none;
}

.navbar-toggler {
  border: none !important;
  outline: none !important;
}

.navbar-toggler:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(224,224,224,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

main.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--panel);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 300;
  padding: 28px 16px 36px;
}

.footer a {
  color: var(--gold);
  text-decoration: none;
}

.footer a:hover {
  color: var(--gold-hover);
}

/* Section Titles */
.section-title {
  text-align: center;
  font-size: var(--fs-section);
  margin-bottom: 1.5rem;
  color: var(--gold);
  font-weight: 300;
  text-transform: none;
  letter-spacing: 2px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(45deg, var(--gold), var(--gold-2));
  margin: 14px auto 0;
  border-radius: 2px;
}

.about-me {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 1.5rem 0.25rem;
}

.about-me::after {
  display: none;
}

.about-content {
  position: relative;
  z-index: 2;
  padding: 0.5rem 1.5rem;
  max-width: 40rem;
}

.about-me h1 {
  font-size: var(--fs-page);
  font-weight: 200;
  text-transform: none;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.about-me p {
  font-size: var(--fs-muted);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* Beat .about-me p so Kaushan tagline size/color actually apply */
.about-me .about-tagline {
  font-family: "Kaushan Script", cursive;
  font-size: var(--fs-script-tagline);
  margin-bottom: 0;
  color: var(--gold);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.hero-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  position: relative;
  transition: color 0.35s ease, letter-spacing 0.35s ease;
}

.hero-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-link:hover {
  color: var(--gold-hover);
  letter-spacing: 5px;
}

.hero-link:hover::after {
  width: 100%;
}

.hero-link .ig-icon {
  display: inline-block;
  vertical-align: middle;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.4em;
  margin-bottom: 0.1em;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-link:hover .ig-icon {
  opacity: 0.8;
  transform: translateY(0);
}

/* ── Instagram Section ──────────────────────────────────────────────────── */
.instagram-section {
  text-align: center;
  margin-top: 0;
  width: 100%;
  padding: 30px 0;
}

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem 0;
  align-items: stretch;
}

.ig-post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ig-post-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(196, 146, 42, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.ig-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.ig-post-user {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.ig-post-username {
  font-weight: 400;
  color: #e0e0e0;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.25s ease;
}

.ig-post-username:hover {
  color: var(--gold);
}

.ig-post-location {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.3px;
}

.ig-post-link {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.ig-post-link:hover {
  opacity: 1;
  transform: scale(1.08);
}

.ig-post-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--input);
}

.ig-post-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.ig-post-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.ig-post-slide > a {
  display: block;
  width: 100%;
  height: 100%;
}

.ig-post-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #f5f5f5;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.25s ease, transform 0.25s ease;
}

.ig-post-play-btn i {
  margin-left: 3px;
}

.ig-post-play-btn:hover {
  background: rgba(196, 146, 42, 0.85);
  transform: translate(-50%, -50%) scale(1.08);
}

.ig-post-play-btn.hidden {
  display: none;
}

.ig-post-slide img,
.ig-post-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-post-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease;
  font-size: 0.85rem;
}

.ig-post-nav:hover {
  background: rgba(196, 146, 42, 0.85);
}

.ig-post-prev { left: 10px; }
.ig-post-next { right: 10px; }

.ig-post-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.ig-post-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.ig-post-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

.ig-post-caption {
  flex: 1;
  padding: 12px 16px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.ig-post-caption-user {
  font-weight: 400;
  color: #e0e0e0;
  margin-right: 6px;
}

@media (max-width: 768px) {
  .instagram-grid {
    grid-template-columns: 1fr;
    align-items: center;
  }
}

.gallery-container {
  max-width: 100%;
  margin: auto;
  padding: 1.5rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(196, 146, 42, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  transition: filter 0.3s ease;
  display: block;
  filter: brightness(0.85);
}

.gallery-item:hover img {
  filter: brightness(1);
}

.overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  text-align: center;
  padding: 20px 15px 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 0 16px 16px;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.overlay p {
  margin: 0;
  font-size: 1rem;
  font-weight: 300;
}

.no-images {
  text-align: center;
  font-size: 1.15rem;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 40px;
}

/* ── View switch + hub-style 3D carousel ─────────────────────────────── */
.view-switch {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.25rem 0 1.25rem;
}

.view-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.95rem;
  border-radius: 4px;
  border: 1px solid var(--border-quiet);
  background: transparent;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.view-switch-link:hover,
.view-switch-link.is-active {
  color: #fff;
  border-color: var(--gold);
  background: rgba(196, 146, 42, 0.18);
}

@media (min-width: 641px) {
  .gallery-container.is-grid .gallery-carousel-view {
    display: none;
  }
}

@media (max-width: 640px) {
  .view-switch,
  .gallery-grid-view {
    display: none;
  }
}

.gallery-carousel {
  --peek: clamp(108px, 18vw, 190px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.15rem;
}

.gallery-carousel-stage {
  position: relative;
  height: min(46vh, 420px);
  min-height: 240px;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  outline: none;
}

.g-card {
  position: absolute;
  top: 4%;
  left: 50%;
  width: min(52%, 420px);
  height: 92%;
  display: block;
  overflow: visible;
  background: transparent;
  border: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transform-style: preserve-3d;
  --turn-x: 0px;
  --turn-y: 0px;
  --turn-z: -160px;
  --turn-ry: 0deg;
}

/* The turn is only the motion. Clipping lives on the face, so Safari can keep the perspective. */
.g-card-turn {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transform: translate3d(calc(-50% + var(--turn-x)), var(--turn-y), var(--turn-z)) rotateY(var(--turn-ry));
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.g-card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-sizing: border-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0.01px);
  transition: border-color 0.68s ease, box-shadow 0.68s ease;
}

.g-card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.68s ease;
}

.g-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.g-card-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.12) 46%, transparent 72%);
  pointer-events: none;
}

.g-card-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.15rem 1rem 1rem;
  text-align: center;
  pointer-events: none;
}

.g-card-kicker {
  display: block;
  color: var(--gold);
  font-weight: 300;
  letter-spacing: 1.5px;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
}

.g-card-title {
  display: block;
  margin-top: 0.2rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  font-weight: 300;
}

.g-card[data-slot="active"] {
  z-index: 3;
  --turn-x: 0px;
  --turn-z: 40px;
  --turn-ry: 0deg;
}

.g-card[data-slot="active"] .g-card-face {
  border: 1px solid rgba(196, 146, 42, 0.65);
  box-shadow: none;
}

.g-card[data-slot="prev"] {
  z-index: 1;
  --turn-x: calc(var(--peek) * -1);
  --turn-z: -72px;
  --turn-ry: 28deg;
}

.g-card[data-slot="next"] {
  z-index: 2;
  --turn-x: var(--peek);
  --turn-z: -72px;
  --turn-ry: -28deg;
}

.g-card[data-slot="prev"] .g-card-face::after,
.g-card[data-slot="next"] .g-card-face::after,
.g-card[data-slot="off"] .g-card-face::after {
  opacity: 1;
}

.g-card[data-slot="off"] {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  --turn-x: 0px;
  --turn-z: -160px;
  --turn-ry: 0deg;
}

.g-card .ig-post-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  aspect-ratio: auto;
}

.g-card .ig-post-nav,
.g-card .ig-post-dots,
.g-card .ig-post-play-btn {
  z-index: 3;
}

.g-card .ig-post-dots {
  bottom: 3.4rem;
}

.g-card-media,
.ig-post-slide img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.gallery-carousel-nav {
  font-family: inherit;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 4px;
  border: 1px solid var(--border-quiet);
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
}

.gallery-carousel-nav-spacer {
  display: block;
  border-color: transparent;
  visibility: hidden;
}

.gallery-carousel-nav:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(196, 146, 42, 0.18);
}

.g-card .g-card-play {
  z-index: 3;
}

@media (max-width: 768px) {
  .about-content {
    padding: 0.25rem 0.75rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* A transformed ancestor flattens preserve-3d, so this section only fades. */
.gallery-container.fade-in,
.gallery-container.fade-in.visible {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ig-post-card:hover,
  .gallery-item:hover {
    transform: none;
  }

  .g-card-turn,
  .g-card-face,
  .g-card-face::after {
    transition: none;
  }
}

@media (max-width: 640px) {
  /* Arrows sit on the stage so the turn has the same room as on a wide screen. */
  .gallery-carousel {
    position: relative;
    display: block;
    --peek: clamp(72px, 20vw, 104px);
  }

  .gallery-carousel-stage {
    height: min(74vw, 420px);
    min-height: 250px;
  }

  .g-card {
    width: min(58%, 250px);
  }

  .g-card-face {
    border-radius: 14px;
  }

  .gallery-carousel-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.42);
  }

  .gallery-carousel-prev {
    left: 0.35rem;
  }

  .gallery-carousel-next {
    right: 0.35rem;
  }

  .gallery-carousel-nav-spacer {
    display: none;
  }

  .gallery-carousel-stage .g-card:not([data-slot="active"]) .g-card-copy {
    opacity: 0;
  }
}

@media (min-width: 641px) {
  .navbar-toggler {
    display: none !important;
  }

  .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 76px;
  }

  .navbar-collapse {
    background: var(--panel);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 16px;
    margin-top: 10px;
    border: 1px solid var(--border);
  }

  .navbar-nav .nav-link {
    color: #e0e0e0 !important;
    padding: 10px 15px;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    color: var(--gold) !important;
  }
}

.alert-container {
  margin-bottom: 20px;
}

.alert {
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: 400;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.alert-success {
  background: linear-gradient(45deg, #065f46, #047857);
  color: #fff;
  border: 1px solid #065f46;
}

.alert-error {
  background: linear-gradient(45deg, #7f1d1d, #dc2626);
  color: #fff;
  border: 1px solid #7f1d1d;
}

.fb-title {
  font-weight: 400;
  font-size: 1.1em;
  margin-bottom: 8px;
  display: block;
}

.fb-description {
  font-weight: 300;
  font-size: 0.9em;
  opacity: 0.9;
  display: block;
}
