/*
 * ski-fun.css — skill.ski micro-animations
 * Import: layout.tsx via <link rel="stylesheet" href="/styles/ski-fun.css">
 * Rule: all animations respect prefers-reduced-motion.
 * DO NOT import into globals.css.
 */

/* ── Snowflake drift (one ❄ every 30s during idle) ── */
@keyframes snowflake-drift {
  0%   { transform: translateX(0)  translateY(-60px) rotate(0deg);   opacity: 0; }
  5%   { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { transform: translateX(40px) translateY(100vh) rotate(360deg); opacity: 0; }
}

.ski-snowflake {
  position: fixed;
  top: 0;
  left: var(--sf-x, 20%);
  pointer-events: none;
  z-index: 9999;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  animation: snowflake-drift 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ── Ski-trail underline on hover for primary links ── */
@keyframes ski-trail-draw {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}

.topbar-link,
.footer-link,
a.hero-sector-link,
a.hero-agent-logo {
  position: relative;
}

.topbar-link::after,
.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent, #ec4899);
  /* zigzag via clip-path */
  clip-path: polygon(
    0% 0%, 4% 100%, 8% 0%, 12% 100%,
    16% 0%, 20% 100%, 24% 0%, 28% 100%,
    32% 0%, 36% 100%, 40% 0%, 44% 100%,
    48% 0%, 52% 100%, 56% 0%, 60% 100%,
    64% 0%, 68% 100%, 72% 0%, 76% 100%,
    80% 0%, 84% 100%, 88% 0%, 92% 100%,
    96% 0%, 100% 100%, 100% 0%
  );
  opacity: 0;
  transition: opacity 150ms ease;
}

.topbar-link:hover::after,
.footer-link:hover::after {
  opacity: 1;
  animation: ski-trail-draw 220ms ease forwards;
}

/* ── Brand-dot hover sparkle ── */
@keyframes sparkle-appear {
  0%   { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  40%  { opacity: 1; transform: scale(1.2) rotate(10deg); }
  100% { opacity: 0; transform: scale(0.8) rotate(0deg); }
}

.wordmark-dot:hover::after {
  content: '✦';
  position: absolute;
  top: -8px;
  right: -10px;
  font-size: 10px;
  color: var(--accent, #ec4899);
  pointer-events: none;
  animation: sparkle-appear 200ms ease forwards;
}

.wordmark-dot {
  position: relative;
  cursor: pointer;
}

/* ── Lift-pass easter-egg toast ── */
@keyframes lift-pass-in {
  0%   { opacity: 0; transform: translateY(12px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lift-pass-out {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.94); }
}

.ski-lift-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 10px 20px;
  background: var(--surface, #111);
  border: 1px solid var(--accent-edge, rgba(236,72,153,0.35));
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--ink, #fff);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 0 0 1px var(--accent-edge, rgba(236,72,153,0.15));
  pointer-events: none;
  animation: lift-pass-in 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ski-lift-toast.leaving {
  animation: lift-pass-out 280ms ease forwards;
}

/* ── Hero video styles ── */
.hero-video-wrap {
  width: 100%;
  height: 60vh;
  overflow: hidden;
  position: relative;
  background: #000;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .hero-video-wrap {
    height: 40vh;
  }
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Hero sector big link ── */
.hero-sector-link-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 28px 20px 12px;
}

.hero-sector-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: linear-gradient(135deg,
    hsl(280 100% 70%) 0%,
    hsl(320 100% 65%) 30%,
    hsl(180 100% 60%) 60%,
    hsl(260 100% 70%) 100%
  );
  background-size: 200% 200%;
  animation: iri-shift 4s ease infinite alternate;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  padding: 4px 0;
}

@keyframes iri-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero-sector-link__text {
  font-family: var(--font-display, sans-serif);
  font-size: clamp(26px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-sector-link__arrow {
  display: inline-flex;
  align-items: center;
  animation: chevron-pulse 1.4s ease-in-out infinite;
}

@keyframes chevron-pulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%       { transform: translateX(6px); opacity: 0.7; }
}

.hero-sector-link__sub {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--ink-3, #888), var(--ink-2, #aaa));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Hero agent logos row ── */
.hero-agents-row {
  width: 100%;
  overflow-x: auto;
  padding: 16px 20px 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hero-agents-row::-webkit-scrollbar {
  display: none;
}

.hero-agents-track {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-content: center;
  min-width: max-content;
  padding: 0 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .hero-agents-track {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
}

.hero-agent-logo {
  font-family: var(--font-display, sans-serif);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-3, #888);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, transform 160ms ease;
  line-height: 1;
}

.hero-agent-logo:hover {
  color: var(--ink, #fff);
  transform: translateY(-2px);
}

/* ── PowerUserBar styles ── */
.power-user-bar {
  width: 100%;
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.08));
  background: var(--surface-2, rgba(0,0,0,0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--topbar-h, 52px);
  z-index: 39;
}

.pub-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 6px;
  background: var(--surface, rgba(0,0,0,0.4));
  color: var(--ink-3, #888);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  flex: 1;
  min-width: 160px;
  max-width: 340px;
  text-align: left;
}

.pub-search:hover {
  border-color: var(--accent-edge, rgba(236,72,153,0.35));
  background: var(--surface-2, rgba(0,0,0,0.6));
  color: var(--ink-2, #bbb);
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  background: var(--surface, rgba(0,0,0,0.4));
  color: var(--ink-2, #bbb);
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
  white-space: nowrap;
}

.pub-btn:hover {
  border-color: var(--accent-edge, rgba(236,72,153,0.35));
  background: var(--surface-2, rgba(0,0,0,0.6));
  color: var(--ink, #fff);
}

.pub-btn--primary {
  border-color: var(--accent-edge, rgba(236,72,153,0.35));
  background: var(--accent-soft, rgba(236,72,153,0.08));
  color: var(--accent, #ec4899);
}

.pub-btn--primary:hover {
  background: var(--accent-soft, rgba(236,72,153,0.15));
  color: var(--accent, #ec4899);
}

.pub-dropdown {
  position: relative;
}

.pub-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--surface, #111);
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  list-style: none;
  padding: 4px;
  margin: 0;
  z-index: 100;
}

.pub-dropdown__menu li button {
  width: 100%;
  padding: 7px 12px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--ink-2, #bbb);
  transition: background 120ms, color 120ms;
}

.pub-dropdown__menu li button:hover {
  background: var(--surface-2, rgba(255,255,255,0.06));
  color: var(--ink, #fff);
}

.pub-dropdown__create button {
  color: var(--accent, #ec4899) !important;
  border-top: 1px solid var(--line, rgba(255,255,255,0.08));
  margin-top: 4px;
  padding-top: 10px !important;
}

.pub-note {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  color: var(--ink-4, #555);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .pub-note {
    display: none;
  }
}

.pub-toast {
  color: var(--accent, #ec4899);
  font-size: 11px;
}

/* ── prefers-reduced-motion: disable everything ── */
@media (prefers-reduced-motion: reduce) {
  .ski-snowflake,
  .hero-sector-link,
  .hero-sector-link__arrow,
  .hero-agent-logo {
    animation: none !important;
    transition: none !important;
  }

  .topbar-link::after,
  .footer-link::after {
    animation: none !important;
  }

  .wordmark-dot:hover::after {
    animation: none !important;
  }

  .ski-lift-toast,
  .ski-lift-toast.leaving {
    animation: none !important;
  }
}
