/* ============================================================
   MCNEISH SOLUTION LLC — COMPONENTS
   Buttons, Forms, Cards, Custom Cursor, Microinteractions
   ============================================================ */

/* ─── CUSTOM CURSOR ──────────────────────────────────────── */
.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  will-change: transform;
}

/* Primary ring — crosshair */
.cursor-ring {
  width: 20px;
  height: 20px;
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              opacity 0.3s;
}

.cursor-ring svg {
  width: 100%;
  height: 100%;
}

/* Center dot */
.cursor-dot {
  width: 4px;
  height: 4px;
  background: var(--copper);
  border-radius: 50%;
  transition: transform 0.1s var(--ease-out-expo),
              opacity 0.2s;
}

/* States */
body.cursor-link .cursor-ring {
  width: 52px;
  height: 52px;
}

body.cursor-drag .cursor-ring {
  width: 60px;
  height: 60px;
}

body.cursor-cta .cursor-ring {
  width: 80px;
  height: 80px;
  opacity: 0;
}

body.cursor-cta .cursor-dot {
  width: 80px;
  height: 80px;
  background: var(--copper-20);
  border: var(--border-copper);
  border-radius: 0;
}

/* ─── BRACKET BUTTON ─────────────────────────────────────── */
.btn-bracket {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory);
  cursor: none;
  position: relative;
  padding: var(--space-16) var(--space-24);
  transition: color var(--duration-mid) var(--ease-out-expo);
}

/* Corner brackets */
.btn-bracket::before,
.btn-bracket::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--copper);
  border-style: solid;
  transition: width var(--duration-mid) var(--ease-out-expo),
              height var(--duration-mid) var(--ease-out-expo);
}

.btn-bracket::before {
  top: 0; left: 0;
  border-width: 1px 0 0 1px;
}

.btn-bracket::after {
  bottom: 0; right: 0;
  border-width: 0 1px 1px 0;
}

.btn-bracket:hover::before,
.btn-bracket:hover::after {
  width: 100%;
  height: 100%;
}

.btn-bracket:hover {
  color: var(--copper-lit);
}

/* Inner fill on hover */
.btn-bracket__fill {
  position: absolute;
  inset: 0;
  background: var(--copper-10);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-mid) var(--ease-out-expo);
}

.btn-bracket:hover .btn-bracket__fill { transform: scaleX(1); }

.btn-bracket__arrow {
  transition: transform var(--duration-mid) var(--ease-out-expo);
}
.btn-bracket:hover .btn-bracket__arrow { transform: translateX(6px); }

/* ─── UNDERLINE LINK ─────────────────────────────────────── */
.link-underline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory);
  cursor: none;
  position: relative;
  padding-bottom: var(--space-4);
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width var(--duration-mid) var(--ease-out-expo);
}

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

.link-underline__arrow {
  transition: transform var(--duration-mid) var(--ease-out-expo);
}
.link-underline:hover .link-underline__arrow { transform: translateX(4px); }

/* ─── EMERGENCY PHONE BUTTON ─────────────────────────────── */
.btn-emergency {
  display: inline-flex;
  align-items: center;
  gap: var(--space-16);
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ivory);
  cursor: none;
  position: relative;
}

.btn-emergency__glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse, var(--copper-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-mid) var(--ease-out-expo);
  pointer-events: none;
}

.btn-emergency:hover .btn-emergency__glow { opacity: 1; }

.btn-emergency__icon {
  width: 40px;
  height: 40px;
  border: var(--border-copper);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-mid) var(--ease-out-expo);
}

.btn-emergency:hover .btn-emergency__icon {
  background: var(--copper);
}

/* ─── STAT COUNTER BLOCK ─────────────────────────────────── */
.stat-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.stat-block__number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 500;
  color: var(--ivory);
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
}

.stat-block__number::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width 1s var(--ease-out-expo);
}

.stat-block.in-view .stat-block__number::after { width: 100%; }

.stat-block__label {
  font-family: var(--font-head);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
}

/* ─── PROJECT PANEL (angled overlay cards) ───────────────── */
.project-panel {
  position: relative;
  overflow: hidden;
  cursor: none;
  background: var(--charcoal);
  transform-style: preserve-3d;
}

.project-panel__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(80%) contrast(1.05);
  transition: filter var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.project-panel:hover .project-panel__image {
  filter: grayscale(0%) contrast(1.0);
  transform: scale(1.04);
}

/* Copper vignette on hover */
.project-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, var(--copper-glow) 100%);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out-expo);
  pointer-events: none;
}

.project-panel:hover::after { opacity: 1; }

.project-panel__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-32);
  background: linear-gradient(transparent, rgba(10, 11, 13, 0.9));
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.project-panel:hover .project-panel__info {
  transform: translateY(0);
  opacity: 1;
}

.project-panel__corner {
  position: absolute;
  top: var(--space-20);
  right: var(--space-20);
  width: 24px;
  height: 24px;
}

.project-panel__corner svg {
  width: 100%;
  height: 100%;
  transform: scale(0.5);
  opacity: 0;
  transition: all var(--duration-mid) var(--ease-out-expo);
}

.project-panel:hover .project-panel__corner svg {
  transform: scale(1);
  opacity: 1;
}

/* ─── TESTIMONIAL BLOCK ──────────────────────────────────── */
.testimonial-block {
  padding: var(--space-80) 0;
  border-bottom: var(--border-ash);
  position: relative;
}

.testimonial-block__name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 7rem);
  font-style: italic;
  font-weight: 700;
  color: var(--ivory);
  margin-bottom: var(--space-32);
  line-height: 1;
}

.testimonial-block__quote {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 300;
  color: var(--ash-light);
  line-height: 1.7;
  max-width: 640px;
}

/* Rating brackets */
.testimonial-rating {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-24);
}

.rating-bracket {
  width: 24px;
  height: 24px;
  border: 1px solid var(--charcoal-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-mid) var(--ease-out-expo);
}

.rating-bracket.filled {
  border-color: var(--copper);
}

.rating-bracket__fill {
  position: absolute;
  inset: 0;
  background: var(--copper-10);
  transform: scaleX(0);
  transform-origin: left;
}

.rating-bracket.filled .rating-bracket__fill {
  transform: scaleX(1);
  transition: transform var(--duration-mid) var(--ease-out-expo);
}

.rating-bracket__icon {
  font-size: 0.625rem;
  color: var(--copper);
  position: relative;
  z-index: 1;
}

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.form-field {
  position: relative;
  margin-bottom: var(--space-24);
}

.form-field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: var(--space-8);
}

.form-field__input,
.form-field__textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--charcoal-mid);
  padding: var(--space-12) 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ivory);
  outline: none;
  transition: border-color var(--duration-mid) var(--ease-out-expo);
  appearance: none;
}

.form-field__input::placeholder,
.form-field__textarea::placeholder {
  color: var(--ash);
  font-style: italic;
}

.form-field__input:focus,
.form-field__textarea:focus {
  border-color: var(--copper);
}

.form-field__line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width var(--duration-mid) var(--ease-out-expo);
}

.form-field__input:focus ~ .form-field__line,
.form-field__textarea:focus ~ .form-field__line {
  width: 100%;
}

.form-field__textarea {
  resize: none;
  min-height: 120px;
}

/* ─── SECTION WAVE DIVIDER ───────────────────────────────── */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}

.wave-divider svg {
  display: block;
  width: 100%;
}

/* ─── SCROLL INDICATOR ───────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: var(--space-32);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  opacity: 0.6;
  animation: scroll-hint-bob 3s ease-in-out infinite;
}

@keyframes scroll-hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50%       { transform: translateX(-50%) translateY(6px); opacity: 0.3; }
}

.scroll-hint__line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--copper), transparent);
  animation: scroll-hint-line 3s ease-in-out infinite;
}

@keyframes scroll-hint-line {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.scroll-hint__text {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--copper);
  writing-mode: horizontal-tb;
}

/* ─── AVAILABILITY DOT ───────────────────────────────────── */
.availability-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.availability-dot__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}

.availability-dot__pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--success);
  animation: avail-pulse 2s ease-out infinite;
  opacity: 0;
}

@keyframes avail-pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.availability-dot__text {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--success);
}

/* ─── CERTIFICATION STAMP ────────────────────────────────── */
.cert-stamp {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  transform: scale(1.3);
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.cert-stamp.stamped {
  opacity: 1;
  transform: scale(1);
}

.cert-stamp__inner {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  line-height: 1.3;
}

/* ─── PROCESS PHASE CARD ─────────────────────────────────── */
.phase-card {
  min-width: min(400px, 80vw);
  padding: var(--space-48);
  background: var(--charcoal);
  border: var(--border-steel);
  border-left: 2px solid var(--copper);
  position: relative;
}

.phase-card__num {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 500;
  color: rgba(184, 115, 51, 0.12);
  position: absolute;
  top: var(--space-16);
  right: var(--space-24);
  line-height: 1;
  letter-spacing: -0.05em;
  pointer-events: none;
}

.phase-card__icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-24);
}

.phase-card__title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ivory);
  margin-bottom: var(--space-12);
}

.phase-card__desc {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ash-light);
  line-height: 1.6;
}

/* ─── LOADING / REVEAL ANIMATIONS ───────────────────────── */

/* Elements hidden before JS initializes */
.reveal-ready {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.reveal-ready.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

/* Clip reveal (from bottom) */
.clip-reveal {
  clip-path: inset(100% 0 0 0);
  transition: clip-path var(--duration-slow) var(--ease-out-expo);
}

.clip-reveal.revealed {
  clip-path: inset(0% 0 0 0);
}

/* ─── MOBILE ADJUSTMENTS ─────────────────────────────────── */
@media (max-width: 768px) {
  .cursor-ring,
  .cursor-dot { display: none; }

  body { cursor: auto; }

  .phase-card { min-width: min(320px, 90vw); }
}

/* ─── THEME TOGGLE BUTTON ────────────────────────────────── */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--charcoal-mid);
  background: transparent;
  color: var(--ash);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none; /* custom cursor */
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-mid) var(--ease-out-expo),
              color var(--duration-mid) var(--ease-out-expo),
              background-color var(--duration-mid) var(--ease-out-expo);
}

.theme-toggle:hover {
  border-color: var(--copper);
  color: var(--ivory);
  background-color: var(--copper-10);
}

.theme-toggle__svg {
  width: 20px;
  height: 20px;
  position: relative;
}

.theme-toggle__svg path {
  transform-origin: center;
  transition: transform var(--duration-mid) var(--ease-spring),
              opacity var(--duration-mid) var(--ease-out-expo);
}

/* Default state: Moon icon visible, Sun hidden */
.theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-45deg) scale(0.5);
}

.theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Light mode state: Sun icon visible, Moon hidden */
html.light-mode .theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

html.light-mode .theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(45deg) scale(0.5);
}

