/* ==========================================================================
   Hoffman Bio — Front-End Theme CSS
   Light / White theme with soft blue/teal gradient orbs
   ========================================================================== */

/* ── Google Fonts preconnect ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS custom properties ──────────────────────────────────────────────── */
:root {
  --hb-white:          #FFFFFF;
  --hb-surface:        #F8FAFC;
  --hb-surface-elev:   #F1F5F9;
  --hb-text:           #0B1220;
  --hb-text-muted:     #475569;
  --hb-text-subtle:    #94A3B8;
  --hb-navy:           #0E4577;
  --hb-electric:       #2563EB;
  --hb-glow:           #60A5FA;
  --hb-border:         rgba(14,69,119,0.12);
  --hb-border-strong:  rgba(14,69,119,0.20);
  --hb-radius-sm:      0.5rem;
  --hb-radius-md:      1rem;
  --hb-radius-lg:      1.5rem;
  --hb-shadow-sm:      0 1px 3px rgba(14,69,119,0.08);
  --hb-shadow-md:      0 4px 16px rgba(14,69,119,0.10);
  --hb-shadow-lg:      0 8px 32px rgba(14,69,119,0.12);
  --hb-shadow-glow:    0 0 32px rgba(37,99,235,0.24);
  --hb-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hb-mono:           'JetBrains Mono', 'Fira Code', monospace;
  --hb-transition:     0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Base resets ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--hb-font);
  background-color: var(--hb-white);
  color: var(--hb-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--hb-electric); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site Header ────────────────────────────────────────────────────────── */
.hb-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--hb-border);
  transition: box-shadow var(--hb-transition);
  width: 100%;
}
.hb-site-header.is-scrolled {
  box-shadow: var(--hb-shadow-md);
}

.hb-header-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 2rem;
}
.hb-header-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hb-header-brand .hb-site-logo img {
  width: 44px;
  height: 44px;
}
.hb-header-inner > .wp-block-navigation,
.hb-header-inner .hb-primary-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.hb-header-cta {
  flex: 0 0 auto;
  margin: 0 !important;
}

/* Hide anything WooCommerce or other plugins try to auto-inject into the header flow */
.hb-site-header .woocommerce,
.hb-site-header .widget_shopping_cart,
.hb-site-header ~ .woocommerce-breadcrumb {
  display: none !important;
}

/* Mobile header */
@media (max-width: 782px) {
  .hb-header-inner {
    flex-wrap: wrap !important;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
  .hb-header-inner > .wp-block-navigation {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

/* ── Site Logo ──────────────────────────────────────────────────────────── */
.hb-site-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.hb-primary-nav .wp-block-navigation__container {
  gap: 0.25rem;
}
.hb-primary-nav a {
  color: var(--hb-text);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color var(--hb-transition), background var(--hb-transition);
}
.hb-primary-nav a:hover,
.hb-primary-nav .current-menu-item > a {
  color: var(--hb-electric);
  background: rgba(37,99,235,0.06);
}

/* ── Hire Me button ─────────────────────────────────────────────────────── */
.hb-hire-btn .wp-block-button__link {
  background: var(--hb-electric);
  color: #fff;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.625rem 1.25rem;
  border: none;
  transition: background var(--hb-transition), transform var(--hb-transition), box-shadow var(--hb-transition);
}
.hb-hire-btn .wp-block-button__link:hover {
  background: var(--hb-navy);
  transform: translateY(-1px);
  box-shadow: var(--hb-shadow-glow);
  text-decoration: none;
}

/* ── Hero Section ───────────────────────────────────────────────────────── */
.hb-hero-section {
  position: relative;
  overflow: hidden;
  background: var(--hb-white);
  min-height: calc(100vh - 72px);
  isolation: isolate;
}

/* Gradient orbs */
.hb-hero-orb-1 {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse 80% 60% at 70% 40%, rgba(96,165,250,0.20) 0%, rgba(37,99,235,0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: hb-float-slow 20s ease-in-out infinite;
}
.hb-hero-orb-2 {
  position: absolute;
  bottom: -10%;
  left: 10%;
  width: 40%;
  height: 50%;
  background: radial-gradient(ellipse 70% 50% at 40% 60%, rgba(20,184,166,0.14) 0%, rgba(14,69,119,0.06) 60%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  animation: hb-float-slow 25s ease-in-out infinite reverse;
}

/* Faded DEVELOPER background word */
.hb-developer-bg-word {
  position: absolute;
  bottom: 8%;
  right: -2%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hb-developer-bg-word span {
  display: block;
  font-family: var(--hb-font);
  font-size: clamp(5rem, 14vw, 13rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--hb-navy);
  opacity: 0.055;
  user-select: none;
  white-space: nowrap;
}

.hb-hero-section .wp-block-columns,
.hb-hero-section .wp-block-column {
  position: relative;
  z-index: 1;
}

/* Hero headline accent */
.hb-accent-name {
  color: var(--hb-navy);
}

/* Hero CTA pill */
.hb-cta-pill .wp-block-button__link {
  transition: transform var(--hb-transition), box-shadow var(--hb-transition), background var(--hb-transition);
}
.hb-cta-pill .wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: var(--hb-shadow-glow);
  text-decoration: none;
}
.hb-cta-ghost .wp-block-button__link:hover {
  background: rgba(37,99,235,0.06) !important;
  text-decoration: none;
}

/* Hero portrait wrapper */
.hb-hero-photo-wrap {
  position: relative;
}
.hb-hero-portrait img {
  width: 100%;
  object-fit: cover;
  border-radius: 1.5rem;
  box-shadow: var(--hb-shadow-lg);
}
.hb-hero-badge {
  position: absolute;
  bottom: 1.5rem;
  left: -1rem;
  box-shadow: var(--hb-shadow-md);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.hb-project-card,
.hb-blog-card {
  background: var(--hb-white);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-md);
  overflow: hidden;
  transition: transform var(--hb-transition), box-shadow var(--hb-transition);
  display: flex;
  flex-direction: column;
}
.hb-project-card:hover,
.hb-blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hb-shadow-lg);
  border-color: var(--hb-border-strong);
}
.hb-project-card .wp-block-post-featured-image img,
.hb-blog-card .wp-block-post-featured-image img {
  transition: transform 0.4s ease;
}
.hb-project-card:hover .wp-block-post-featured-image img,
.hb-blog-card:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

/* ── Masonry Grid ───────────────────────────────────────────────────────── */
.hb-masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
}
.hb-masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .hb-masonry-grid { column-count: 2; } }
@media (max-width: 560px) { .hb-masonry-grid { column-count: 1; } }

/* ── Timeline ───────────────────────────────────────────────────────────── */
.hb-timeline {
  position: relative;
  padding-left: 2rem;
}
.hb-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--hb-electric), transparent);
  border-radius: 1px;
}
.hb-timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hb-timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.375rem;
  width: 12px;
  height: 12px;
  background: var(--hb-electric);
  border-radius: 50%;
  border: 2px solid var(--hb-white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
.hb-timeline-content { display: flex; flex-direction: column; gap: 0; }

/* ── Minimal project rows ───────────────────────────────────────────────── */
.hb-minimal-row {
  cursor: default;
  transition: background var(--hb-transition);
}
.hb-minimal-row:hover { background: rgba(37,99,235,0.03); }
.hb-minimal-arrow a {
  display: inline-block;
  transition: transform var(--hb-transition);
}
.hb-minimal-row:hover .hb-minimal-arrow a { transform: translateX(4px); }

/* ── CTA Banner ─────────────────────────────────────────────────────────── */
.hb-cta-inner {
  position: relative;
  overflow: hidden;
}
.hb-cta-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 80% 40%, rgba(96,165,250,0.18) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Feature / Service / Value cards ───────────────────────────────────── */
.hb-feature-card,
.hb-service-card,
.hb-value-card,
.hb-tech-card {
  transition: transform var(--hb-transition), box-shadow var(--hb-transition), border-color var(--hb-transition);
}
.hb-feature-card:hover,
.hb-service-card:hover,
.hb-value-card:hover,
.hb-tech-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hb-shadow-md);
  border-color: var(--hb-border-strong);
}
.hb-service-card--featured {
  background: var(--hb-navy) !important;
}

/* ── Testimonial cards ──────────────────────────────────────────────────── */
.hb-testimonial-card {
  transition: transform var(--hb-transition), box-shadow var(--hb-transition);
}
.hb-testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hb-shadow-md);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.hb-site-footer {
  position: relative;
  overflow: hidden;
}
.hb-footer-watermark {
  position: absolute;
  bottom: -1rem;
  right: -2rem;
  font-family: var(--hb-font);
  font-size: clamp(6rem, 18vw, 16rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--hb-navy);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
}
.hb-footer-watermark::after { content: 'JH.'; }

/* ── Embed wrappers ─────────────────────────────────────────────────────── */
.hb-embed-wrapper {
  position: relative;
  border-radius: var(--hb-radius-md);
  overflow: hidden;
}
.hp-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--hb-radius-md);
  overflow: hidden;
}
.hp-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--hb-radius-md);
}
.hp-embed-fallback {
  padding: 2rem;
  background: var(--hb-surface);
  border-radius: var(--hb-radius-md);
  text-align: center;
}

/* ── Smart Gallery ──────────────────────────────────────────────────────── */
.hb-smart-gallery--masonry {
  column-count: 3;
  column-gap: 1rem;
}
.hb-smart-gallery--masonry .hb-gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
}
.hb-smart-gallery--justified-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}
.hb-smart-gallery--justified-rows .hb-gallery-item {
  flex: 1 1 200px;
}
.hb-smart-gallery--uniform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.hb-smart-gallery--carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.hb-smart-gallery--carousel .hb-gallery-item {
  flex: 0 0 320px;
  scroll-snap-align: start;
}
.hb-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--hb-radius-sm);
  cursor: pointer;
  transition: opacity var(--hb-transition);
}
.hb-gallery-item img:hover { opacity: 0.9; }

/* Lightbox */
.hb-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.hb-lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--hb-radius-md);
  box-shadow: var(--hb-shadow-xl, 0 20px 48px rgba(0,0,0,0.5));
}
.hb-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Social links (logos always visible) ───────────────────────────────── */
.wp-block-social-links .wp-social-link {
  background-color: transparent !important;
}
.wp-block-social-links .wp-social-link svg {
  fill: currentColor !important;
}
.wp-block-social-links.has-icon-color .wp-social-link {
  color: var(--hb-text-muted) !important;
}
.wp-block-social-links .wp-social-link:hover {
  color: var(--hb-electric) !important;
  transform: translateY(-2px);
  transition: color var(--hb-transition), transform var(--hb-transition);
}

/* ── Scroll reveal (JS adds class) ─────────────────────────────────────── */
.hb-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hb-reveal.is-visible {
  opacity: 1;
  transform: none;
}
.hb-reveal-delay-1 { transition-delay: 0.1s; }
.hb-reveal-delay-2 { transition-delay: 0.2s; }
.hb-reveal-delay-3 { transition-delay: 0.3s; }
.hb-reveal-delay-4 { transition-delay: 0.4s; }

/* ── Eyebrow text ───────────────────────────────────────────────────────── */
.hb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hb-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── WooCommerce overrides ──────────────────────────────────────────────── */
.hb-woo-fallback {
  display: none;
}
/* Show fallback when woo isn't active (JS toggles) */
body:not(.woocommerce-active) .hb-woo-fallback {
  display: block;
}
.hb-add-to-cart .wp-block-button__link,
button.single_add_to_cart_button {
  background: var(--hb-electric) !important;
  border-radius: 9999px !important;
  color: #fff !important;
  font-weight: 600 !important;
  border: none !important;
  transition: background var(--hb-transition), transform var(--hb-transition) !important;
}
.hb-add-to-cart .wp-block-button__link:hover,
button.single_add_to_cart_button:hover {
  background: var(--hb-navy) !important;
  transform: translateY(-1px) !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hb-developer-bg-word span { font-size: 8rem; }
}
@media (max-width: 768px) {
  .hb-hero-section { min-height: auto; }
  .hb-header-inner { padding: 0.75rem 1rem; }
  .hb-developer-bg-word { display: none; }
  .hb-hero-orb-1, .hb-hero-orb-2 { opacity: 0.5; }
  .hb-masonry-grid { column-count: 2; }
  .hb-footer-watermark { display: none; }
}
@media (max-width: 480px) {
  .hb-masonry-grid { column-count: 1; }
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes hb-float-slow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(20px, -15px) scale(1.04); }
  66%  { transform: translate(-10px, 10px) scale(0.97); }
}

/* ── Accessibility ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--hb-electric);
  outline-offset: 3px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hb-hero-orb-1, .hb-hero-orb-2 { animation: none; }
  .hb-reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Print ──────────────────────────────────────────────────────────────── */
@media print {
  .hb-site-header, .hb-site-footer, .hb-hero-orb-1, .hb-hero-orb-2, .hb-developer-bg-word { display: none; }
}
