html {
  scroll-behavior: smooth;
}

/* ---------- Tailwind build-gap patches ----------
   css/tailwind.css is a static, pre-built file (no CDN/JIT anymore), and it
   is missing several utility classes used in index.html (it was last built
   before these were added, or before a value changed). Rebuilding it needs
   `npm run build:css`, which this environment can't run, so these are the
   same classes hand-written as plain CSS until a real rebuild happens. */
.rounded-3xl { border-radius: 1.5rem; }
.p-6 { padding: 1.5rem; }
.mt-14 { margin-top: 3.5rem; }
.bg-gradient-to-b.from-accent\/\[0\.07\].to-transparent {
  background-image: linear-gradient(to bottom, rgba(153, 86, 246, 0.07), rgba(153, 86, 246, 0));
}
.shadow-\[0_30px_80px_-30px_rgba\(153\,86\,246\,0\.35\)\] { box-shadow: 0 30px 80px -30px rgba(153, 86, 246, 0.35); }
.shadow-\[0_20px_60px_-20px_rgba\(0\,0\,0\,0\.6\)\] { box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6); }
.shadow-\[0_10px_30px_-8px_rgba\(153\,86\,246\,0\.7\)\] { box-shadow: 0 10px 30px -8px rgba(153, 86, 246, 0.7); }
.shadow-\[0_10px_30px_-8px_rgba\(153\,86\,246\,0\.8\)\] { box-shadow: 0 10px 30px -8px rgba(153, 86, 246, 0.8); }
@media (min-width: 640px) {
  .sm\:p-10 { padding: 2.5rem; }
  .sm\:whitespace-nowrap { white-space: nowrap; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:p-12 { padding: 3rem; }
  .lg\:gap-14 { gap: 3.5rem; }
}

/* The native [hidden] attribute loses to any Tailwind utility that also
   sets `display` (e.g. flex/grid) because both have equal specificity and
   Tailwind's stylesheet loads after the UA sheet. Force it to always win so
   a "hidden" element is never left invisibly intercepting clicks. */
[hidden] {
  display: none !important;
}

body {
  background-color: #070808;
}

::selection {
  background: #9956f6;
  color: #070808;
}

/* ---------- Site-wide curl-noise particle background ---------- */
.curl-field-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.curl-field-bg canvas {
  display: block;
}

.curl-field-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 300px at var(--mx, -999px) var(--my, -999px), rgba(153, 86, 246, 0.1), transparent 70%);
  opacity: var(--glow, 0);
}

.hero-cutout {
  mix-blend-mode: screen;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(7, 8, 8, 0.92) 0%,
    rgba(7, 8, 8, 0.72) 38%,
    rgba(7, 8, 8, 0.25) 68%,
    rgba(7, 8, 8, 0.05) 100%
  );
}

/* ---------- Projects carousel ---------- */
.carousel-track {
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline: 1px solid rgba(153, 86, 246, 0.6);
  outline-offset: 6px;
  border-radius: 1rem;
}

.carousel-track.dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
  user-select: none;
}

.carousel-card {
  -webkit-user-drag: none;
}

#carouselBar {
  transition: width 0.2s ease;
}

/* ---------- Typing code window (About) ---------- */
.code-window {
  box-shadow: 0 0 40px rgba(153, 86, 246, 0.12);
}

#typedCode {
  color: #d9c8fb;
}

#typedCode .tk-k { color: #9956f6; font-weight: 600; }
#typedCode .tk-s { color: #c4a0fa; }
#typedCode .tk-n { color: #e9b8ff; }
#typedCode .tk-f { color: #b57bff; }
#typedCode .tk-p { color: #7d6a9e; }
#typedCode .tk-c { color: #6b5a8a; font-style: italic; }

.code-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  background: #9956f6;
  vertical-align: -0.2em;
  animation: caret-blink 1s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

/* ---------- Section seam dividers ---------- */
.section-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Cookie consent ---------- */
.cookie-banner {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.cookie-banner.in {
  transform: translateY(0);
  opacity: 1;
}

.cookie-modal-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-modal-overlay.in {
  opacity: 1;
}

.cookie-modal {
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.cookie-modal-overlay.in .cookie-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cookie-toggle {
  display: inline-flex;
}

.cookie-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cookie-toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.cookie-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s ease;
}

.cookie-toggle input:checked + .cookie-toggle-track {
  background: #9956f6;
  border-color: #9956f6;
}

.cookie-toggle input:checked + .cookie-toggle-track .cookie-toggle-thumb {
  transform: translateX(18px);
}

.cookie-toggle input:focus-visible + .cookie-toggle-track {
  outline: 2px solid #9956f6;
  outline-offset: 2px;
}

/* ---------- Cursor-follow card glow ---------- */
.card-glow {
  position: relative;
  isolation: isolate;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%), rgba(153, 86, 246, 0.16), transparent 70%);
  pointer-events: none;
}

.card-glow:hover::before,
.card-glow:active::before {
  opacity: 1;
}

/* ---------- Magnetic buttons ---------- */
.magnetic {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ---------- Stoke featured slideshow ---------- */
#stokeSlideshow {
  aspect-ratio: 1 / 1;
}

.stoke-slide {
  opacity: 0;
  transition: opacity 1s ease;
}

.stoke-slide.active {
  opacity: 1;
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal-line,
.js .section-divider {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal-line.in,
.js .section-divider.in {
  transform: scaleX(1);
}

/* ---------- Misc ---------- */
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .code-caret {
    animation: none;
  }
  .cookie-banner,
  .cookie-modal-overlay,
  .cookie-modal {
    transition: none;
  }
  .js .reveal,
  .js .reveal-line,
  .js .section-divider {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* FAQ: esconde o marcador padrão do <details> */
summary::-webkit-details-marker { display: none; }
