@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Fonts Local Declarations */

/* NYTCheltenhamLight */
@font-face {
  font-family: 'NYTCheltenhamLight';
  src: url('/fonts/NYTCheltenhamLight/NYTCheltenhamLight.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTCheltenhamLight';
  src: url('/fonts/NYTCheltenhamLight/NYTCheltenhamLightItalic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NYTCheltenhamLightSC';
  src: url('/fonts/NYTCheltenhamLight/NYTCheltenhamLightSC.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* NYTFranklin */
@font-face {
  font-family: 'NYTFranklinLight';
  src: url('/fonts/NYTFranklin/NYTFranklinLight.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinLightItalic';
  src: url('/fonts/NYTFranklin/NYTFranklinLightItalic.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinMedium';
  src: url('/fonts/NYTFranklin/NYTFranklinMedium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinItalic';
  src: url('/fonts/NYTFranklin/NYTFranklinMediumItalic.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklin';
  src: url('/fonts/NYTFranklin/NYTFranklinMedium.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinSemibold';
  src: url('/fonts/NYTFranklin/NYTFranklinSemibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinBold';
  src: url('/fonts/NYTFranklin/NYTFranklinBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinBoldItalic';
  src: url('/fonts/NYTFranklin/NYTFranklinBoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinExtraBold';
  src: url('/fonts/NYTFranklin/NYTFranklinExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NYTFranklinExtraBoldItalic';
  src: url('/fonts/NYTFranklin/NYTFranklinExtraBoldItalic.otf') format('opentype');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@layer base {
  body {
    @apply antialiased text-slate-200 bg-slate-950;
    font-family: 'NYTCheltenhamLight', Georgia, serif;
  }

  .font-serif-vintage {
    font-family: 'NYTCheltenhamLight', Georgia, serif;
  }

  .font-serif-vintage-book {
    font-family: 'NYTCheltenhamLight', Georgia, serif;
    font-weight: 600;
    font-style: normal;
  }

  .font-inter {
    font-family: 'NYTCheltenhamLight', sans-serif;
  }

  .font-franklin {
    font-family: 'NYTFranklin', sans-serif;
  }

  .font-franklin-bold {
    font-family: 'NYTFranklinBold', sans-serif;
  }
}

:root {
  --app-width: min(95vw, 95vh * 9 / 16);
  --app-height: min(95vh, 95vw * 16 / 9);

  /* Scalable Font Sizes */
  --font-size-xxs: clamp(8px, calc(var(--app-width) * 0.018), 40px);
  --font-size-xs: clamp(10px, calc(var(--app-width) * 0.024), 54px);
  --font-size-sm: clamp(12px, calc(var(--app-width) * 0.03), 64px);
  --font-size-base: clamp(14px, calc(var(--app-width) * 0.036), 76px);
  --font-size-lg: clamp(16px, calc(var(--app-width) * 0.042), 90px);
  --font-size-xl: clamp(18px, calc(var(--app-width) * 0.05), 108px);
  --font-size-2xl: clamp(22px, calc(var(--app-width) * 0.06), 130px);
  --font-size-3xl: clamp(26px, calc(var(--app-width) * 0.07), 150px);
  --font-size-4xl: clamp(32px, calc(var(--app-width) * 0.085), 180px);

  /* Scalable Touch Targets */
  --touch-target-hotspot: clamp(48px, calc(var(--app-width) * 0.08), 140px);
  --touch-target-nav: clamp(48px, calc(var(--app-width) * 0.095), 160px);
  --touch-target-close: clamp(44px, calc(var(--app-width) * 0.075), 120px);

  /* Scalable Dimensions */
  --logo-size: clamp(44px, calc(var(--app-width) * 0.12), 240px);
  --indicator-dot-size: clamp(16px, calc(var(--app-width) * 0.03), 72px);
}

.text-scalable-xxs {
  font-size: var(--font-size-xxs);
}

.text-scalable-xs {
  font-size: var(--font-size-xs);
}

.text-scalable-sm {
  font-size: var(--font-size-sm);
}

.text-scalable-base {
  font-size: var(--font-size-base);
}

.text-scalable-lg {
  font-size: var(--font-size-lg);
}

.text-scalable-xl {
  font-size: var(--font-size-xl);
}

.text-scalable-2xl {
  font-size: var(--font-size-2xl);
}

.text-scalable-3xl {
  font-size: var(--font-size-3xl);
}

.text-scalable-4xl {
  font-size: var(--font-size-4xl);
}

.app-canvas {
  width: var(--app-width);
  height: var(--app-height);
  margin: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Custom Hotspot Animations */
@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4), 0 0 0 0 rgba(255, 255, 255, 0.15);
  }

  50% {
    box-shadow: 0 0 0 clamp(6px, calc(var(--app-width)*0.015), 24px) rgba(255, 255, 255, 0), 0 0 0 clamp(12px, calc(var(--app-width)*0.03), 48px) rgba(255, 255, 255, 0);
  }
}

.animate-hotspot-pulse {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fine-grain paper texture overlay */
.paper-grain {
  position: relative;
}

.paper-grain::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}