/* FieldNerve Events — Premium Cinematic UI */

:root {
  --bg-deep: #050505;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f5;
  --text-muted: rgba(255, 255, 255, 0.55);
  --accent: #ea580c;
  --accent-glow: rgba(234, 88, 12, 0.35);
  --font-display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.home-page {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
}

body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* Cinematic background */
.bg-cinematic {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(234, 88, 12, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(234, 88, 12, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(255, 255, 255, 0.03), transparent),
    var(--bg-deep);
}

.bg-cinematic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg-deep);
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loader-text {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.loader-text::first-letter {
  color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.8s var(--ease-out) forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Site footer */
.site-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Home page */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: clamp(1rem, 3vh, 2rem) 1.25rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.home__header {
  text-align: center;
  margin-bottom: clamp(1rem, 2.5vh, 1.75rem);
  max-width: 640px;
  width: 100%;
}

.home__logo-link {
  display: block;
  line-height: 0;
  margin: 0 auto 0.875rem;
  max-width: 280px;
  width: 100%;
}

.home__logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44px;
  aspect-ratio: 1024 / 164;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}

.home__title {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.home__subtitle {
  font-size: clamp(0.8125rem, 2vw, 0.9375rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.45;
}

.cards {
  display: grid;
  gap: clamp(0.625rem, 1.5vh, 1rem);
  width: 100%;
  max-width: 960px;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-height: 760px) {
  .home__logo {
    max-height: 36px;
  }

  .home__logo-link {
    max-width: 230px;
  }

  .home__header {
    margin-bottom: 0.875rem;
  }

  .card {
    padding: 1.125rem 1.125rem;
    gap: 0.5rem;
  }

  .card__title {
    font-size: 1.0625rem;
  }

  .card__desc {
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border-glass);
  border-radius: 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-out),
    border-color 0.4s,
    box-shadow 0.4s,
    background 0.4s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(234, 88, 12, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
  background: rgba(255, 255, 255, 0.06);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  font-size: 1.5rem;
  opacity: 0.9;
}

.card__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.card__title {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card__arrow {
  margin-top: auto;
  font-size: 1.25rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease-out);
}

.card:hover .card__arrow {
  transform: translateX(4px);
}

/* Embed pages (video + pdf) */
.embed-page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
}

.embed-page__nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.embed-page:hover .embed-page__nav,
.embed-page__nav:focus-within {
  opacity: 1;
}

.embed-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.embed-page__back:hover {
  background: rgba(234, 88, 12, 0.2);
  border-color: rgba(234, 88, 12, 0.4);
}

.embed-page__title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.embed-frame-wrap {
  flex: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* PDF.js viewer */
.pdf-viewer {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: #ffffff;
}

.pdf-viewer__nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
}

.pdf-scroll {
  width: 100%;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #ffffff;
  padding-bottom: 4.5rem;
}

.pdf-page {
  display: flex;
  justify-content: center;
  width: 100%;
  background: #ffffff;
}

.pdf-page + .pdf-page {
  border-top: 1px solid #f1f5f9;
}

.pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.pdf-nav {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background: transparent;
  transform: translateX(-50%);
}

.pdf-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 9999px;
  background: rgba(234, 88, 12, 0.2);
  color: #ea580c;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.pdf-nav__btn svg {
  width: 1.4rem;
  height: 1.4rem;
}

.pdf-nav__btn:hover:not(:disabled) {
  background: rgba(234, 88, 12, 0.35);
  transform: scale(1.06);
}

.pdf-nav__btn:active:not(:disabled) {
  transform: scale(0.96);
}

.pdf-nav__btn:disabled {
  background: rgba(234, 88, 12, 0.2);
  color: rgba(234, 88, 12, 0.45);
  cursor: not-allowed;
}

.pdf-nav__indicator {
  min-width: 4.5rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.pdf-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem;
  color: #64748b;
  text-align: center;
}
