/* ==========================================================================
   Pysgod Media Group — shared stylesheet
   One file, variable-driven. Components never hardcode colours; they pull
   from the custom properties below so the theme toggle drives every page.
   ========================================================================== */

/* ---- Theme variables ---------------------------------------------------- */
:root,
[data-theme="dark"] {
  --bg-page:        #0d0d0d;
  --bg-card:        #1c1c1e;
  --bg-alt:         #232325;
  --border:         #2e2e30;
  --text-primary:   #f2f2f2;
  --text-secondary: #9a9a9a;
  --text-tertiary:  #6e6e70;
  --accent:         #00bf63;
  --accent-soft:    rgba(0, 191, 99, 0.16);

  --logo-badge:     #ffffff;   /* brand badge behind the logo, both themes */

  --shadow:         0 18px 50px -18px rgba(0, 0, 0, 0.75);
  --shadow-soft:    0 6px 22px -10px rgba(0, 0, 0, 0.6);
  --glare:          rgba(255, 255, 255, 0.16);

  /* Background pattern treatment */
  --bg-filter:      invert(1) brightness(0.55);
  --bg-opacity:     0.06;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg-page:        #f2f2f2;
  --bg-card:        #ffffff;
  --bg-alt:         #e9e9ec;
  --border:         #d9d9dd;
  --text-primary:   #111111;
  --text-secondary: #5b5b60;
  --text-tertiary:  #8a8a8f;
  --accent:         #00bf63;
  --accent-soft:    rgba(0, 191, 99, 0.12);

  --shadow:         0 18px 50px -20px rgba(0, 0, 0, 0.22);
  --shadow-soft:    0 6px 22px -12px rgba(0, 0, 0, 0.18);
  --glare:          rgba(255, 255, 255, 0.55);

  --bg-filter:      none;
  --bg-opacity:     0.05;

  color-scheme: light;
}

/* ---- Reset / base ------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: "SF Pro Rounded", ui-rounded, "Hiragino Maru Gothic ProN",
               "Quicksand", "Nunito", "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Fixed background pattern layer ------------------------------------- */
.bg-layer {
  position: fixed;
  inset: -10vmax;            /* overscan so parallax never reveals an edge */
  z-index: -2;
  background-image: url("/bkg.svg");
  background-repeat: repeat;
  background-size: 40px 20px;
  filter: var(--bg-filter);
  opacity: var(--bg-opacity);
  pointer-events: none;
  will-change: transform;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* A soft radial wash keeps the centre brighter than the corners. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    120% 90% at 50% 0%,
    transparent 0%,
    transparent 55%,
    color-mix(in srgb, var(--bg-page) 70%, transparent) 100%
  );
}

/* ---- Theme toggle ------------------------------------------------------- */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease,
              transform 0.25s ease, background 0.4s ease;
}
.theme-toggle:hover { color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0) scale(0.94); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

/* Show the sun in dark mode (tap for light), the moon in light mode. */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---- Layout shell ------------------------------------------------------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 88px 20px 92px;
  perspective: 1100px;        /* ancestor for the 3D tilt */
}

/* ---- Hero --------------------------------------------------------------- */
.hero { text-align: center; }

.hero h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

/* ---- Pill (the signature motif) ---------------------------------------- */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
}

/* Glare overlay — a highlight that tracks the cursor across the surface. */
.pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    var(--glare), transparent 42%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.fancy-mode .tilt:hover::after { opacity: 1; }

.social-pill {
  gap: 6px;
  padding: 9px 16px 9px 9px;
}

/* Circular brand logo inside the pill */
.pill-logo {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--logo-badge);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease;
}
.pill-logo svg,
.pill-logo img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}
.pill-logo:hover { transform: rotate(-6deg) scale(1.05); }

/* Thin vertical divider */
.pill-divider {
  flex: none;
  width: 1px;
  align-self: stretch;
  margin: 6px 8px 6px 4px;
  background: var(--border);
}

.pill-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Circular icon links */
.icon-link {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
  will-change: transform;
}
.icon-link svg { width: 20px; height: 20px; display: block; }
.icon-link:hover { color: var(--accent); background: var(--accent-soft); }

/* Tooltip driven by the data-tip attribute */
.icon-link[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 6px);
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.icon-link[data-tip]::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translate(-50%, 6px) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.icon-link[data-tip]:hover::before { opacity: 1; transform: translate(-50%, 0); }
.icon-link[data-tip]:hover::after  { opacity: 1; transform: translate(-50%, 0) rotate(45deg); }

/* ---- Footer / copyright pill -------------------------------------------- */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 5;
  text-align: center;
  pointer-events: none;       /* only the pill itself is interactive */
}
.copyright {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 7px 16px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

/* ---- Custom cursor (desktop, fancy-mode) -------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}
.cursor-dot {
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid var(--accent);
  transition: opacity 0.3s ease, width 0.18s ease, height 0.18s ease,
              margin 0.18s ease, background 0.18s ease;
}
.cursor-ring.is-hover {
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  background: var(--accent-soft);
}
.cursor-ring.is-down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
html.cursor-active.fancy-mode,
html.cursor-active.fancy-mode * { cursor: none; }
html.cursor-active .cursor-dot,
html.cursor-active .cursor-ring { opacity: 1; }

/* ---- Entrance animations (fancy-mode only) ------------------------------ */
/* Only hidden once effects.js has marked the document ready, so a JS failure
   (or no JS at all) leaves content fully visible. */
.fancy-mode.js-anim .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in,
.reveal-all .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ---- Touch devices: no cursor/tilt, gentle motion instead --------------- */
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }

  .fancy-mode .float { animation: bob 5.5s ease-in-out infinite; }
  .icon-link:active,
  .pill-logo:active { transform: scale(0.95); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ---- Respect reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 420px) {
  .social-pill { padding: 8px 12px 8px 8px; }
  .icon-link { width: 38px; height: 38px; }
  .pill-logo { width: 40px; height: 40px; }
}
