/* ==========================================================================
   GSP Capital - Visual Enhancements & Effects
   ========================================================================== */

/* --------------------------------------------------------------------------
   Diagonal Split Banner (Portfolio page)
   -------------------------------------------------------------------------- */

.page-hero--diagonal {
  position: relative;
  display: flex;
  align-items: center;
  height: 380px;
  background-color: var(--color-primary);
  margin-top: 80px; /* offset for fixed header */
}

/* Remove the navy scrim overlay — diagonal variant controls its own image */
.page-hero--diagonal::before {
  display: none;
}

.page-hero__diagonal-text {
  position: relative;
  z-index: 2;
  width: 40%;
  padding: 0 3rem 0 clamp(1.5rem, 5vw, 5rem);
  flex-shrink: 0;
  color: var(--color-white);
}

.page-hero--diagonal .page-hero__diagonal-text .section-header__label {
  color: var(--color-accent);
}

.page-hero--diagonal .page-hero__diagonal-text .section-header__title {
  color: var(--color-white);
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  margin-bottom: 0;
}

.page-hero__diagonal-image {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  background-size: cover;
  background-position: center;
  clip-path: polygon(12% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* --------------------------------------------------------------------------
   Diagonal Hero — Stats Panel (image-free right half)
   -------------------------------------------------------------------------- */

.page-hero__diagonal-stats {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  clip-path: polygon(12% 0%, 100% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(135deg, #3a1e12 0%, #1a0f0a 60%, #0a0a1a 100%);
  display: flex;
  align-items: center;
  padding-left: 18%;
  padding-right: 6%;
}

.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-stats__item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  padding: var(--spacing-lg) 0;
}

.hero-stats__item + .hero-stats__item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stats__number {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  font-weight: var(--font-bold);
  color: var(--color-accent);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}

.hero-stats__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* Mobile: stack vertically */
@media (max-width: 767px) {
  .page-hero--diagonal {
    height: auto;
    flex-direction: column;
    margin-top: 70px;
    position: relative;
    z-index: 2;
  }

  /* Pull the portfolio section up so category banners slide just behind the hero bottom */
  .page-hero--diagonal + .section {
    position: relative;
    z-index: 1;
    margin-top: -1.5rem;
  }

  /* Image-variant hero: image fills background behind the title */
  .page-hero--diagonal:has(.page-hero__diagonal-image) {
    min-height: 260px;
    justify-content: flex-end;
  }

  .page-hero__diagonal-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    clip-path: none;
  }

  /* Dark scrim so title text stays readable */
  .page-hero__diagonal-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(44, 24, 16, 0.92) 0%,
      rgba(44, 24, 16, 0.45) 60%,
      rgba(44, 24, 16, 0.15) 100%
    );
  }

  .page-hero__diagonal-text {
    width: 100%;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    position: relative;
    z-index: 2;
  }

  .page-hero__diagonal-stats {
    position: relative;
    width: 100%;
    height: auto;
    clip-path: none;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
    flex-direction: row;
    justify-content: space-around;
    background: linear-gradient(to bottom, #1a0f0a, #0a0a1a);
  }

  .hero-stats {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  .hero-stats__item {
    align-items: center;
    text-align: center;
    padding: 0;
    flex: 1;
  }

  .hero-stats__item + .hero-stats__item {
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Sectors item: revert to column on mobile, hide the button */
  .hero-stats__item--sectors {
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-1);
  }

  .hero-sector-nav__control {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Hero Sector Navigation Toggle
   -------------------------------------------------------------------------- */

.hero-sector-nav {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.hero-sector-nav__control {
  position: relative;
  flex-shrink: 0;
}

.hero-sector-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
}

@media (hover: hover) {
  .hero-sector-nav__toggle:hover {
    color: var(--color-accent-light);
  }
}

.hero-sector-nav__toggle svg {
  transition: transform 0.3s ease;
}

/* Mobile: chevron points down, rotates up when open */
.hero-sector-nav__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Base dropdown — mobile-first (stacks below title) */
.hero-sector-nav__dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: 0.5rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.hero-sector-nav__dropdown.is-open {
  max-height: 320px;
  opacity: 1;
}

/* Sectors stat item — text stack + toggle button side by side */
.hero-stats__item--sectors {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

.hero-stats__item-text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
}

/* Desktop: dropdown opens to the right of the button */
@media (min-width: 768px) {
  .hero-sector-nav__toggle svg {
    /* chevron points right */
    transform: rotate(-90deg);
  }

  .hero-sector-nav__toggle[aria-expanded="true"] svg {
    transform: rotate(90deg);
  }

  .hero-sector-nav__dropdown {
    position: absolute;
    left: calc(100% + 0.75rem);
    right: auto;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    margin-top: 0;
    max-height: none;
    overflow: visible;
    min-width: 230px;
    background: rgba(8, 18, 34, 0.97);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .hero-sector-nav__dropdown.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
    max-height: none;
  }
}

.hero-sector-nav__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
}

@media (hover: hover) {
  .hero-sector-nav__link:hover {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    padding-left: 1.1rem;
  }

  .hero-sector-nav__link:hover span {
    opacity: 1;
    transform: translateX(4px);
  }
}

.hero-sector-nav__link span {
  opacity: 0.4;
  font-size: 0.85em;
  transition: opacity 0.2s, transform 0.2s;
}

/* --------------------------------------------------------------------------
   Glassmorphism
   -------------------------------------------------------------------------- */

.glass {
  background: var(--color-surface-bg-subtle);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-surface-bg-subtle);
}

.glass--dark {
  background: var(--color-glass-dark);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-surface-border-ghost);
}

/* --------------------------------------------------------------------------
   Gradient Text
   -------------------------------------------------------------------------- */

.gradient-text {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Hover Effects
   -------------------------------------------------------------------------- */

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-scale {
  transition: transform var(--transition-base);
}

@media (hover: hover) {
  .hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
  }

  .hover-glow:hover {
    box-shadow: 0 0 30px var(--color-accent-ghost);
  }

  .hover-scale:hover {
    transform: scale(1.05);
  }
}

/* --------------------------------------------------------------------------
   Counter Animation
   -------------------------------------------------------------------------- */

.counter {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Dividers
   -------------------------------------------------------------------------- */

.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-block: var(--spacing-8);
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  height: 2px;
}

/* --------------------------------------------------------------------------
   Link Underline Animation
   -------------------------------------------------------------------------- */

.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

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

/* --------------------------------------------------------------------------
   Pulse Animation
   -------------------------------------------------------------------------- */

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --------------------------------------------------------------------------
   Badge Styles
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-radius: var(--radius-full);
}

.badge--gold {
  background: var(--color-accent-muted);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

/* --------------------------------------------------------------------------
   Scrollbar Styling
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-400) var(--color-gray-100);
}

/* --------------------------------------------------------------------------
   Selection Styling
   -------------------------------------------------------------------------- */

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

::-moz-selection {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Hub-and-Spoke Sector Wheel (Portfolio Hero)
   -------------------------------------------------------------------------- */

.page-hero__diagonal-wheel {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  clip-path: polygon(12% 0%, 100% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(135deg, #3a1e12 0%, #1a0f0a 60%, #0a0a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sector-wheel {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Orbit ring */
.wheel__orbit {
  opacity: 0;
  animation: wheel-fade-in 0.8s ease 0.2s forwards;
}

/* Center circle + text */
.wheel__center,
.wheel__center-text {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: wheel-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}

/* Pulse ring emanating from center */
.wheel__pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: wheel-pulse 2.8s ease-out 1.8s infinite;
}

@keyframes wheel-pulse {
  0%   { transform: scale(1);   opacity: 0.35; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Spokes — draw outward from center */
.wheel__spoke {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
}
.wheel__spoke--0 { animation: wheel-draw-spoke 0.55s ease 0.85s forwards; }
.wheel__spoke--1 { animation: wheel-draw-spoke 0.55s ease 1.00s forwards; }
.wheel__spoke--2 { animation: wheel-draw-spoke 0.55s ease 1.15s forwards; }
.wheel__spoke--3 { animation: wheel-draw-spoke 0.55s ease 1.30s forwards; }
.wheel__spoke--4 { animation: wheel-draw-spoke 0.55s ease 1.45s forwards; }

@keyframes wheel-draw-spoke {
  to { stroke-dashoffset: 0; }
}

/* Nodes — spring-pop after their spoke finishes */
.wheel__node-group {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.wheel__node-group--0 { animation: wheel-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.35s forwards; }
.wheel__node-group--1 { animation: wheel-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.50s forwards; }
.wheel__node-group--2 { animation: wheel-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.65s forwards; }
.wheel__node-group--3 { animation: wheel-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.80s forwards; }
.wheel__node-group--4 { animation: wheel-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.95s forwards; }

@keyframes wheel-pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes wheel-fade-in {
  to { opacity: 1; }
}

/* Hover effects on nodes */
.wheel__node-link { cursor: pointer; }

.wheel__node-link:hover .wheel__node {
  stroke: rgba(243, 112, 33, 0.9);
  stroke-width: 2;
  fill: rgba(243, 112, 33, 0.1);
}

.wheel__node-link:hover .wheel__label {
  fill: rgba(243, 112, 33, 0.9);
}

/* Wheel: fill behind title on smaller screens */
@media (max-width: 991px) {
  .page-hero__diagonal-wheel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    clip-path: none;
    background: linear-gradient(135deg, #3a1e12 0%, #1a0f0a 60%, #0a0a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .page-hero__diagonal-wheel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(44, 24, 16, 0.92) 0%,
      rgba(44, 24, 16, 0.45) 60%,
      rgba(44, 24, 16, 0.15) 100%
    );
    pointer-events: none;
  }
}

/* --------------------------------------------------------------------------
   Mobile stats bar (portfolio page — hidden on desktop)
   -------------------------------------------------------------------------- */

.portfolio-stats-mobile {
  display: flex;
  justify-content: space-around;
  background: linear-gradient(to bottom, #1a0f0a, #0a0a1a);
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
}

.portfolio-stats-mobile__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  gap: var(--spacing-1);
}

.portfolio-stats-mobile__item + .portfolio-stats-mobile__item {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.portfolio-stats-mobile__number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: var(--font-bold);
  color: var(--color-accent);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}

.portfolio-stats-mobile__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Founder photo — reduced size on mobile
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .founder-photo {
    max-width: 180px;
    margin-bottom: var(--spacing-6);
  }
}

/* --------------------------------------------------------------------------
   Portfolio Sidebar Layout (Option 1)
   -------------------------------------------------------------------------- */

.portfolio-layout {
  display: flex;
  gap: var(--spacing-12);
  align-items: flex-start;
}

.sector-sidebar {
  width: 210px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  align-self: flex-start;
}

.sector-nav__heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--spacing-4) var(--spacing-4);
}

.sector-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.sector-nav__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-3) var(--spacing-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
  line-height: 1.35;
  gap: var(--spacing-3);
}

.sector-nav__name {
  flex: 1;
}

.sector-nav__count {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  padding: 0.1em 0.5em;
  font-weight: var(--font-normal);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

@media (hover: hover) {
  .sector-nav__link:hover {
    color: var(--color-text);
    border-left-color: var(--color-accent);
    padding-left: var(--spacing-5);
  }
}

.sector-nav__link.is-active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  padding-left: var(--spacing-5);
}

.sector-nav__link.is-active .sector-nav__count {
  background: var(--color-accent-muted);
  color: var(--color-accent);
}

.sector-content {
  flex: 1;
  min-width: 0;
}

/* Hide sidebar on mobile — hero dropdown handles navigation */
@media (max-width: 991px) {
  .portfolio-layout {
    display: block;
  }

  .sector-sidebar {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Home page — logo matches all other pages (consistent left-aligned)
   -------------------------------------------------------------------------- */
