/* ==========================================================================
   Rotary District 3011 — site.css
   Verbatim custom CSS blocks ported from the React app's src/index.css.
   Tailwind utilities are supplied separately (Tailwind config + Preflight).
   Hex values, easings and timings are copied exactly — do NOT paraphrase.
   ========================================================================== */

:root {
  color-scheme: light;
}

html {
  height: 100%;
}

/* Body must GROW with content (min-height), not be locked to a fixed 100% height.
   It is a flex column, so a fixed height makes the browser shrink the children to
   fit — squashing the fixed-height header/contact strip on inner pages. The home
   page only escaped this because Lenis sets `html.lenis body { height: auto }`. */
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: #1a2b4a;
}

/* Light-blue page with a subtle dotted texture (matches the design background) */
.page-texture {
  background-color: #eef3fb;
  background-image: radial-gradient(rgba(22, 66, 155, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Slim custom scrollbar used inside the list cards */
.slim-scroll {
  scrollbar-width: thin;
  scrollbar-color: #c7d2e6 transparent;
}
.slim-scroll::-webkit-scrollbar {
  width: 6px;
}
.slim-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.slim-scroll::-webkit-scrollbar-thumb {
  background: #c7d2e6;
  border-radius: 9999px;
}
.slim-scroll::-webkit-scrollbar-thumb:hover {
  background: #a9b7ce;
}

/* Lenis smooth scrolling (see js/effects/smooth-scroll.js). */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Header: white logo wedge. The clip-path lives on this white layer (never on
   the logo content). The blue header shows wherever the wedge is clipped away,
   so the diagonal is the white->blue transition on the left. */
/* The wedge bottom edge is fixed to the header height (Site.Master h-[70px] /
   md:h-20 = 70/80px). If you change the header height, recompute these paths or
   blue shows through below the white wedge. */
.logo-curve {
  clip-path: path('M 0 0 H 180 C 232 18, 225 62, 255 80 L 0 80 Z');
}
@media (max-width: 767px) {
  .logo-curve {
    clip-path: path('M 0 0 H 150 C 195 16, 190 54, 214 70 L 0 70 Z');
  }
}

/* Desktop nav "slot machine" hover: each letter is a 4-deep vertical reel of
   the same letter. On hover the reel scrolls down through 3 rows and decelerates
   to rest on an identical copy (so rest/end look seamless), staggered left->right
   via an inline --d delay so the reels stop one after another — jackpot style. */
.slot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.slot-text {
  display: inline-flex;
  align-items: center;
}
.slot-col {
  display: inline-block;
  height: 1.25em;
  overflow: hidden;
  vertical-align: middle;
}
.slot-col > .slot-reel {
  display: block;
  transform: translateY(0);
}
.slot-col > .slot-reel > span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.25em;
  line-height: 1;
  white-space: pre;
}
.slot-link:hover .slot-reel,
.slot-link:focus-visible .slot-reel {
  animation: slot-spin 0.6s cubic-bezier(0.18, 0.7, 0.12, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes slot-spin {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-75%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .slot-link:hover .slot-reel,
  .slot-link:focus-visible .slot-reel {
    animation: none;
  }
}

/* --- Entrance animations --- */

/* Cards fade + rise in on first paint. Stagger is set via inline
   animation-delay where the cards are rendered. */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-enter {
  animation: card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* List rows fade + rise as they scroll into view inside a card. Scroll-driven
   where supported (Chrome 115+); elsewhere rows simply render in their final
   visible state, so content is never hidden. */
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@supports (animation-timeline: view()) {
  .row-animate {
    animation: row-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 34%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .card-enter,
  .row-animate {
    animation: none !important;
  }
}

/* ===========================================================================
   DOUBLE STAIRCASE PAGE TRANSITION
   Eight full-height columns split into two interlocking staircases:
   even columns = brand blue, enter from the TOP; odd columns = brand gold,
   enter from the BOTTOM. A left-to-right per-column stagger (set inline via
   animation-delay) gives the stepped staircase rhythm.

   Timing here MUST match js/effects/staircase.js:
     COLUMNS=8  SLIDE_MS=380 (--pt-slide)  STAGGER_MS=60 (inline)  HOLD_MS=90
   Overlay z-index 3000 clears the sticky header (z-1000) and modals (z-2000).
   =========================================================================== */
.pt-overlay {
  --pt-slide: 380ms;
  --pt-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow: hidden;
  pointer-events: none;
}
.pt-overlay.pt-idle {
  display: none;
}
.pt-col {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  will-change: transform;
}
.pt-top {
  transform: translateY(-100%);
}
.pt-bottom {
  transform: translateY(100%);
}
.pt-blue {
  background: #16429b;
}
.pt-gold {
  background: #f5a623;
}
.pt-overlay[data-stage='cover'] .pt-top {
  animation: pt-cover-top var(--pt-slide) var(--pt-ease) both;
}
.pt-overlay[data-stage='cover'] .pt-bottom {
  animation: pt-cover-bottom var(--pt-slide) var(--pt-ease) both;
}
.pt-overlay[data-stage='reveal'] .pt-top {
  animation: pt-reveal-top var(--pt-slide) var(--pt-ease) both;
}
.pt-overlay[data-stage='reveal'] .pt-bottom {
  animation: pt-reveal-bottom var(--pt-slide) var(--pt-ease) both;
}
@keyframes pt-cover-top {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes pt-cover-bottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes pt-reveal-top {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}
@keyframes pt-reveal-bottom {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pt-overlay,
  .pt-overlay.pt-active {
    display: none !important;
  }
  .pt-col {
    animation: none !important;
  }
}

/* CircularGallery (Our Projects) — from React CircularGallery.css */
.circular-gallery {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
}
.circular-gallery:active {
  cursor: grabbing;
}
.circular-gallery:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* Responsive header nav spacing to prevent collision on medium screens */
@media (min-width: 1440px) and (max-width: 1535px) {
  .site-header .main-nav {
    gap: 0.25rem !important;
  }
  .site-header .main-nav .slot-link {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 12px !important;
  }
  .site-header .header-actions {
    gap: 0.5rem !important;
  }
  .site-header .header-actions .slot-link {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    font-size: 12px !important;
  }
  .site-header > div {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}



/* ==========================================================================
   Galleries Fallback Layout Styles (when Tailwind CDN is blocked or offline)
   ========================================================================== */

/* Circular Gallery styling */
.projects-gallery {
  overflow: hidden;
  cursor: grab;
  user-select: none;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  position: relative;
  height: 420px;
}
@media (max-width: 639px) {
  .projects-gallery {
    height: 380px;
  }
}
.cg-track {
  display: flex;
  gap: 1.5rem;
  padding-left: 3rem;
  padding-right: 3rem;
  transition: transform 100ms ease-out;
  height: 100%;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.cg-card {
  width: 240px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(241, 245, 249, 0.5);
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 300ms ease-out, box-shadow 300ms ease-out;
  cursor: default;
}
@media (max-width: 639px) {
  .cg-card {
    width: 200px;
  }
}
.cg-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.cg-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #f8fafc;
  position: relative;
}
@media (max-width: 639px) {
  .cg-img-wrap {
    height: 150px;
  }
}
.cg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms;
}
.cg-img:hover {
  transform: scale(1.05);
}
.cg-text-wrap {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.cg-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.cg-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #0B2B6B;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dome Gallery styling */
.photo-gallery {
  position: relative;
  width: 100%;
  height: 650px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
@media (max-width: 639px) {
  .photo-gallery {
    height: 550px;
  }
}
.dg-scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  transform-style: preserve-3d;
}
.dg-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.4;
  transition: all 1000ms;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 0, 58, 0.15) 50%, transparent 100%);
  transform: translateZ(-300px);
}
.dg-globe {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 100ms;
  width: 0px;
  height: 0px;
  transform-style: preserve-3d;
}
.dg-card {
  position: absolute;
  width: 140px;
  height: 105px;
  background-color: transparent;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: none;
  padding: 0px;
  cursor: pointer;
  transition: all 300ms ease-out;
  transform-origin: center;
  overflow: hidden;
}
@media (max-width: 639px) {
  .dg-card {
    width: 100px;
    height: 75px;
  }
}
.dg-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #f8fafc;
  position: relative;
}
@media (max-width: 639px) {
  .dg-img-wrap {
    height: 100%;
  }
}
.dg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.dg-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.25rem;
  user-select: none;
  pointer-events: none;
}
.dg-title {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  color: #1e293b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dg-footer {
  font-size: 7px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
