/* ============================================================
   CUSTOM STYLES — Bennett Soricelli Portfolio
   Layered on top of Bootstrap 5.3
   ============================================================ */

/* --------------------------------------------------------
   CSS CUSTOM PROPERTIES
   -------------------------------------------------------- */
:root {
  --bg:          #0f0f0f;
  --surface:     #161616;
  --surface-2:   #1e1e1e;
  --border:      #2a2a2a;
  --text:        #f0f0f0;
  --text-muted:  #888888;
  --accent:      #4f7ef8;       /* primary blue */
  --accent-hover:#3b68e0;
  --radius:      10px;
  --nav-h:       64px;
  --transition:  0.2s ease;
  /* Updated by theme-switcher.js to match the cube's selected theme. */
  --cta-gradient: linear-gradient(135deg, #ff7820 0%, #ff10a0 50%, #4428c8 100%);
  --theme-accent: #ff10a0;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* Each section is taller than the viewport, with content centered
   vertically, so only one section's content is visible at a time
   during normal scrolling — there's always an empty stretch
   between the bottom of one block and the top of the next. */
#work,
#about,
#workflow,
#contact {
  min-height: 125vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* #hero overrides this to provide a 200vh scroll-jack runway —
   see the HERO block below. */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Offset anchor targets so the fixed nav doesn't cover them */
:target {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* --------------------------------------------------------
   TYPOGRAPHY UTILITIES
   -------------------------------------------------------- */
.text-muted { color: var(--text-muted) !important; }

.ls-wide { letter-spacing: 0.08em; }

/* --------------------------------------------------------
   BOOTSTRAP OVERRIDES
   -------------------------------------------------------- */

/* Primary button — gradient sourced from the current cube theme,
   slowly drifting via animated background-position. */
.btn-primary {
  background: var(--cta-gradient);
  background-size: 220% 220%;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 500;
  border-radius: var(--radius);
  animation: cta-flow 6s ease-in-out infinite alternate;
  transition: transform var(--transition), filter var(--transition),
              box-shadow var(--transition);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--cta-gradient);
  background-size: 220% 220%;
  border-color: transparent;
  color: #fff;
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

@keyframes cta-flow {
  from { background-position: 0%   50%; }
  to   { background-position: 100% 50%; }
}

/* Antigravity strip — full-width section below the footer with
   the same body background as the rest of the site, overlaying a
   particle ring that follows the cursor in the cube's accent color. */
.antigravity-section {
  width: 100%;
  height: 400px;
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
}
.antigravity-section canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Outline secondary button */
.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--surface-2);
  border-color: var(--text-muted);
  color: var(--text);
  transform: translateY(-1px);
}

/* Hero "Get in Touch" CTA — borderless; hover paints the WORDS
   with the moving cube-theme gradient (no bg fill, no lift). */
.section-hero .btn-outline-secondary {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: color var(--transition);
}
.section-hero .btn-outline-secondary:hover,
.section-hero .btn-outline-secondary:focus {
  background: var(--cta-gradient);
  background-size: 220% 220%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  border-color: transparent;
  transform: none;
  animation: cta-flow 6s ease-in-out infinite alternate;
}

/* Form controls */
.form-control {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  background-color: var(--surface);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(79, 126, 248, 0.18);
}

.form-label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

/* Alerts */
.alert-success {
  background-color: rgba(25, 195, 125, 0.12);
  border-color: rgba(25, 195, 125, 0.25);
  color: #19c37d;
}
.alert-danger {
  background-color: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.25);
  color: #f87171;
}

/* --------------------------------------------------------
   NAVBAR
   -------------------------------------------------------- */
#main-nav {
  height: var(--nav-h);
  background-color: rgba(15, 15, 15, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition);
}

.navbar-brand {
  color: var(--text) !important;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.nav-link {
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem !important;
  border-radius: 6px;
  transition: color var(--transition), background-color var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--text) !important;
  background-color: var(--surface-2);
}

/* Mobile menu */
.navbar-toggler {
  border-color: var(--border);
  padding: 0.35rem 0.6rem;
}
.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%28240%2C240%2C240%2C0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-collapse {
  background-color: var(--surface);
  border-radius: var(--radius);
  margin-top: 0.5rem;
  padding: 0.5rem;
}
@media (min-width: 768px) {
  .navbar-collapse {
    background-color: transparent;
    margin-top: 0;
    padding: 0;
  }
}

/* --------------------------------------------------------
   SECTION UTILITIES
   -------------------------------------------------------- */
.py-6 { padding-top: 6rem; padding-bottom: 6rem; }

.section-divider {
  display: none;
}

.section-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.section-header h2 { color: var(--text); }

/* --------------------------------------------------------
   HERO
   -------------------------------------------------------- */
/* Hero is a 200vh scroll runway. Inside it, .hero-pin is sticky and
   stays at the top of the viewport for 100vh of scroll — page looks
   pinned while the rows scroll-jack into place. */
.section-hero {
  min-height: 200vh;
  position: relative;
  padding-top: 0;
}
.hero-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--nav-h);
}

/* Scroll-driven reveal for hero rows — JS drives transform/opacity. */
.hero-reveal {
  opacity: 0;
  transform: translate3d(0, 90px, 0);
  will-change: transform, opacity;
}
span.hero-reveal {
  display: inline-block;
}

/* Pill tag */
.pill-tag {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  letter-spacing: 0.02em;
}

/* Hero headline */
.section-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.section-hero .lead {
  font-size: 1.1rem;
  max-width: 520px;
}

/* --------------------------------------------------------
   CUBE HERO — SHINY TEXT
   -------------------------------------------------------- */
@keyframes shiny-sweep {
  to { background-position: 200% center; }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(5px); opacity: 1; }
}

.scroll-hint-arrow {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  animation: scroll-bounce 1.6s ease-in-out infinite;
}

.shiny-text {
  display: inline-block;
  background-image: linear-gradient(
    90deg,
    #a0a0a0 0%,
    #a0a0a0 35%,
    #ffffff 50%,
    #a0a0a0 65%,
    #a0a0a0 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 3s linear infinite;
}

/* --------------------------------------------------------
   PROJECT CARDS
   -------------------------------------------------------- */
.project-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  /* transform driven by js/tilt.js — TiltedCard-style 3D mouse tilt */
  will-change: transform;
  transform-style: preserve-3d;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}

/* Card thumbnail. Empty div falls back to a subtle gradient
   placeholder; if an <img> is nested inside, it covers the box. */
.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2) 0%, #222 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.project-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--theme-accent);
  transition: color var(--transition);
}

.project-card .card-body { border: none; }
.project-card .card-text { color: var(--text-muted); }

.link-arrow {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), gap var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.link-arrow:hover { color: var(--text); }
.link-arrow .bi { transition: transform var(--transition); }
.link-arrow:hover .bi { transform: translateX(3px); }

/* --------------------------------------------------------
   ABOUT — SKILL TAGS
   -------------------------------------------------------- */
.skill-tag {
  display: inline-block;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  transition: border-color var(--transition), color var(--transition);
}
.skill-tag:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* --------------------------------------------------------
   WORKFLOW
   -------------------------------------------------------- */
.workflow-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.workflow-step {
  display: flex;
  flex-direction: row-reverse;     /* icon right, text left of it */
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
  transition: transform var(--transition);
  text-decoration: none;           /* anchor reset for linked steps */
  color: inherit;
}
.workflow-step:hover {
  transform: translateX(-3px);
  text-decoration: none;
  color: inherit;
}
a.workflow-step:hover .workflow-step__label {
  color: var(--theme-accent, var(--text));
}
.workflow-step__icon {
  font-size: 2rem;
  line-height: 1;
  flex: 0 0 auto;
  background: var(--cta-gradient);
  background-size: 220% 220%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cta-flow 6s ease-in-out infinite alternate;
}
.workflow-step__text {
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
}
.workflow-step__label {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.workflow-step__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}
.workflow-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;       /* right-aligned arrow */
  color: var(--text-muted);
  font-size: 1.1rem;
  padding-right: 1.5rem;
}

/* --------------------------------------------------------
   CONTACT
   -------------------------------------------------------- */
.section-contact .section-header h2 { color: var(--text); }

/* When the cube has expanded into the section background, swap text
   colors to dark so the form remains readable on the white plane. */
.section-contact.contact-arrived .section-header h2,
.section-contact.contact-arrived .form-label {
  color: #1a1a1a;
}
.section-contact.contact-arrived .text-muted {
  color: #444 !important;
}
.section-contact.contact-arrived .form-control {
  background-color: #ffffff;
  border-color: #c8c8c8;
  color: #1a1a1a;
}
.section-contact.contact-arrived .form-control::placeholder {
  color: #888;
}

/* --------------------------------------------------------
   FOOTER
   -------------------------------------------------------- */
.site-footer { background-color: var(--bg); }

.social-link {
  color: var(--text-muted);
  font-size: 1.15rem;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
}
.social-link:hover {
  color: var(--text);
  transform: translateY(-2px);
}

/* --------------------------------------------------------
   RESPONSIVE TWEAKS
   -------------------------------------------------------- */
@media (max-width: 575.98px) {
  .py-6 { padding-top: 4rem; padding-bottom: 4rem; }
  .section-hero { min-height: auto; padding-top: calc(var(--nav-h) + 3rem); padding-bottom: 4rem; }
}

/* --------------------------------------------------------
   CUBE THEME / SHAPE SWITCHER
   -------------------------------------------------------- */
.theme-switcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.theme-switcher.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.theme-switcher__btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: conic-gradient(from 0deg,
    #ff7820, #ffd700, #5eb866, #2bbcff, #4428c8, #cc22a0, #ff10a0, #ff7820);
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-switcher__btn::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.theme-switcher__btn:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.theme-switcher.is-open .theme-switcher__btn {
  transform: rotate(45deg);
}

.theme-switcher__panel {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 210px;
  padding: 14px;
  background: rgba(22, 22, 22, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.theme-switcher.is-open .theme-switcher__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-switcher__label {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin: 2px 2px 8px;
}

.theme-switcher__swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.theme-switcher__swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-switcher__swatch:hover {
  transform: scale(1.1);
}
.theme-switcher__swatch.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.theme-switcher__shapes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.theme-switcher__shape {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-switcher__shape:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}
.theme-switcher__shape.is-active {
  background: rgba(79, 126, 248, 0.18);
  border-color: rgba(79, 126, 248, 0.45);
  color: var(--text);
}
