/*
Theme Name: CHID Esports — Coming Soon
Theme URI: https://chidesports.com/
Author: CHID Esports
Description: Custom animated CHID Esports coming-soon landing page with a rotating iridescent ring and mouse-responsive wordmark. No page builder or plugin required.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chid-esports-coming-soon
*/

:root {
  color-scheme: dark;
  --background: #020307;
  --foreground: #f2f3f7;
  --page-gutter: 20px;
  --ring-shift-x: 0px;
  --ring-shift-y: 0px;
  --ring-tilt-x: 0deg;
  --ring-tilt-y: 0deg;
  --logo-shift-x: 0px;
  --logo-shift-y: 0px;
  --ring-duration: 10s; /* One full wheel rotation every 10 seconds. */
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; background: var(--background); }
body {
  margin: 0;
  min-width: 280px;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.chid-page {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  padding: clamp(24px, 4vh, 55px) var(--page-gutter) 76px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 48% 35% at 50% 49%, rgba(12, 22, 47, 0.16), transparent 85%),
    #020307;
}

.chid-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 54% 48% at 50% 51%, transparent 43%, rgba(0,0,0,.5) 100%);
}

.chid-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-2px);
}

/* The two transparent assets share the same 3:2 artboard, so they line up. */
.chid-artwork {
  position: relative;
  width: min(1100px, 96vw, calc((100dvh - 192px) * 1.5));
  max-width: 100%;
  aspect-ratio: 3 / 2;
  min-width: 0;
  perspective: 1400px;
  transform-style: preserve-3d;
  user-select: none;
}

.chid-ring-parallax,
.chid-wordmark-parallax,
.chid-ring-rotor,
.chid-ring-image,
.chid-wordmark {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chid-ring-parallax {
  z-index: 1;
  transform:
    translate3d(var(--ring-shift-x), var(--ring-shift-y), 0)
    rotateX(var(--ring-tilt-x))
    rotateY(var(--ring-tilt-y));
  transform-style: preserve-3d;
  will-change: transform;
}

/* Central-axis wheel rotation, NOT an orbit around another point. */
.chid-ring-rotor {
  transform-origin: 50% 50%;
  animation: chid-wheel-spin var(--ring-duration, 10s) linear infinite;
  will-change: transform;
}

.chid-ring-image {
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 0 14px rgba(38, 106, 248, .11));
  animation: chid-lustre 7s ease-in-out infinite alternate;
}

.chid-wordmark-parallax {
  z-index: 2;
  transform: translate3d(var(--logo-shift-x), var(--logo-shift-y), 0);
  will-change: transform;
}

.chid-wordmark {
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 1px 4px rgba(230, 239, 255, .06));
}

.chid-coming-soon {
  z-index: 3;
  position: relative;
  margin: clamp(-28px, -2.5vh, -12px) 0 0;
  padding-left: .52em; /* visually balance letter spacing */
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(12px, 1.6vw, 20px);
  line-height: 1.5;
  letter-spacing: .52em;
  text-align: center;
  text-transform: uppercase;
  color: rgba(245, 247, 255, .93);
  text-shadow: 0 0 20px rgba(184, 206, 255, .12);
}

.chid-footer {
  position: absolute;
  z-index: 4;
  inset: auto 15px max(20px, env(safe-area-inset-bottom)) 15px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(208, 213, 231, .48);
}

.chid-accessible-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes chid-wheel-spin {
  from { transform: rotate(0turn); }
  to   { transform: rotate(1turn); }
}

@keyframes chid-lustre {
  from { filter: saturate(.93) brightness(.93) drop-shadow(0 0 8px rgba(75, 123, 245, .08)); }
  to   { filter: saturate(1.14) brightness(1.07) drop-shadow(0 0 22px rgba(72, 146, 246, .17)); }
}

/* WordPress admin toolbar: keep the layout centred in the remaining viewport. */
body.admin-bar .chid-page { min-height: calc(100dvh - 32px); }

@media (max-width: 782px) {
  body.admin-bar .chid-page { min-height: calc(100dvh - 46px); }
}

@media (max-width: 680px) {
  .chid-page { padding: 24px 10px 80px; }
  .chid-artwork { width: 110vw; max-width: none; }
  .chid-coming-soon {
    margin-top: 2px;
    font-size: clamp(11px, 2.65vw, 17px);
    letter-spacing: .34em;
    padding-left: .34em;
  }
  .chid-footer { font-size: 9px; letter-spacing: .16em; }
}

@media (max-height: 650px) and (min-width: 681px) {
  .chid-artwork { width: min(850px, 92vw, calc((100dvh - 110px) * 1.5)); }
  .chid-page { padding-bottom: 42px; }
  .chid-coming-soon { margin-top: -24px; }
  .chid-footer { bottom: 12px; }
}

/* Optional motion switch appears only when the browser requests reduced motion.
   This makes the ring usable even when Windows/macOS animation effects are off,
   while respecting the preference until the visitor explicitly opts in. */
.chid-motion-toggle {
  display: none;
  position: fixed;
  z-index: 12;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(173, 192, 240, .35);
  border-radius: 40px;
  background: rgba(11, 16, 30, .85);
  color: #f5f7ff;
  font: 500 11px/1.2 Arial, sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chid-motion-toggle:focus-visible {
  outline: 2px solid #9ec9ff;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.chid-motion-opt-in) .chid-ring-rotor,
  body:not(.chid-motion-opt-in) .chid-ring-image { animation: none !important; }
  body:not(.chid-motion-opt-in) .chid-ring-parallax,
  body:not(.chid-motion-opt-in) .chid-wordmark-parallax { transform: none !important; }
  .chid-motion-toggle { display: inline-flex; }
}
