/*
Theme Name: The Spectra Group
Theme URI: https://thespectragroup.org/
Author: The Spectra Group
Description: Flagship single-page theme for The Spectra Group. Activate it and the homepage is ready. Partner names and emails are edited under Appearance > Customize > Partner contacts. Animation timings are in this file, in the MOTION CONTROL PANEL below.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spectra
*/

/* --------------------------------------------------------------------------
   HOW TO EDIT ANIMATIONS
   In WordPress: Appearance > Theme File Editor > style.css (this file).
   Change the numbers in the MOTION CONTROL PANEL and click "Update File".
   -------------------------------------------------------------------------- */

/* ==========================================================================
   MOTION CONTROL PANEL
   Every animation and hover on the page reads its timing from these variables.
   Change a number here and it changes everywhere. Nothing else to touch.
   ========================================================================== */
:root {
  /* 1. Hero fade-in */
  --tsg-fade-duration: 1000ms;   /* how long each hero line takes to fade in   */
  --tsg-fade-stagger: 220ms;     /* delay between one hero line and the next    */
  --tsg-fade-distance: 14px;     /* how far each line rises while fading in     */

  /* 2. Ticker (manifesto section) */
  --tsg-ticker-speed: 38s;       /* time for one full loop; higher = slower     */

  /* 3. Pillar hover reveal */
  --tsg-pillar-speed: 450ms;     /* how fast the hidden pillar text opens       */

  /* 4. Contact link hover */
  --tsg-link-speed: 200ms;       /* how fast email links shift to Electric Mint */

  /* Shared easing curve for all of the above */
  --tsg-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
::selection { background: #39FF14; color: #1B3320; }
:focus-visible { outline: 2px solid #39FF14; outline-offset: 4px; }
h1, h2, h3, blockquote p { text-wrap: balance; }

/* ==========================================================================
   1. HERO FADE-IN
   Add class "tsg-fade" to any element and set style="--i: N" to order it.
   --i: 0 starts immediately, --i: 1 waits one stagger step, and so on.
   Plays once on page load. No scroll trigger, no JavaScript.
   ========================================================================== */
@keyframes tsg-fade-up {
  from { opacity: 0; transform: translateY(var(--tsg-fade-distance)); }
  to   { opacity: 1; transform: none; }
}
.tsg-fade {
  animation: tsg-fade-up var(--tsg-fade-duration) var(--tsg-ease) both;
  animation-delay: calc(var(--i, 0) * var(--tsg-fade-stagger));
}

/* ==========================================================================
   2. TICKER (CSS-only marquee)
   The track holds the same text twice. It slides left by exactly half its
   width, so the second copy lands where the first started and the loop is
   seamless. To change the words, edit BOTH copies in the HTML.
   ========================================================================== */
@keyframes tsg-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tsg-ticker-track {
  display: flex;
  width: max-content;
  animation: tsg-ticker var(--tsg-ticker-speed) linear infinite;
}
/* Pause when someone hovers to read it. Delete this rule to keep it moving. */
.tsg-ticker:hover .tsg-ticker-track { animation-play-state: paused; }

/* ==========================================================================
   3. PILLAR HOVER REVEAL
   The detail text sits in a grid row that animates from 0fr (closed) to
   1fr (open). This opens to the text's natural height with no fixed
   max-height to maintain. It opens on hover and on keyboard focus.
   ========================================================================== */
.tsg-pillar-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows var(--tsg-pillar-speed) var(--tsg-ease),
    opacity var(--tsg-pillar-speed) var(--tsg-ease);
}
.tsg-pillar-detail > div { overflow: hidden; }
.tsg-pillar {
  transition: background-color var(--tsg-pillar-speed) var(--tsg-ease);
}
.tsg-pillar-bar {                       /* lime bar along the top edge */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--tsg-pillar-speed) var(--tsg-ease);
}
.tsg-pillar-muted {                     /* label + subtitle brighten on hover for contrast */
  transition: color var(--tsg-pillar-speed) var(--tsg-ease);
}
.tsg-pillar:hover, .tsg-pillar:focus-within { background-color: #556644; }
.tsg-pillar:hover .tsg-pillar-muted,
.tsg-pillar:focus-within .tsg-pillar-muted { color: #FFFFFF; }
.tsg-pillar:hover .tsg-pillar-detail,
.tsg-pillar:focus-within .tsg-pillar-detail { grid-template-rows: 1fr; opacity: 1; }
.tsg-pillar:hover .tsg-pillar-bar,
.tsg-pillar:focus-within .tsg-pillar-bar { transform: scaleX(1); }

/* Phones and tablets have no hover, so the detail text is simply shown. */
@media (hover: none) {
  .tsg-pillar-detail { grid-template-rows: 1fr; opacity: 1; }
  .tsg-pillar-bar { transform: scaleX(1); }
}

/* ==========================================================================
   4. CONTACT LINK HOVER
   Email links shift from white to Electric Mint (#7BFF8D).
   ========================================================================== */
.tsg-link {
  color: #FFFFFF;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: #84A981;
  transition:
    color var(--tsg-link-speed) ease,
    text-decoration-color var(--tsg-link-speed) ease;
}
.tsg-link:hover, .tsg-link:focus-visible { color: #7BFF8D; text-decoration-color: #7BFF8D; }

/* ==========================================================================
   REDUCED MOTION
   Visitors who ask their device for less motion get a fully static page.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tsg-fade { animation: none; }
  .tsg-ticker-track { animation: none; }
  .tsg-ticker { overflow-x: auto; }
  .tsg-pillar, .tsg-pillar-detail, .tsg-pillar-bar, .tsg-pillar-muted, .tsg-link { transition: none; }
}

/* ==========================================================================
   INNER PAGES (blog posts and ordinary pages)
   Basic readable styling for content written in the WordPress editor.
   ========================================================================== */
.tsg-prose { font-size: 1.125rem; line-height: 1.7; }
.tsg-prose > * + * { margin-top: 1.25em; }
.tsg-prose h2, .tsg-prose h3, .tsg-prose h4 { font-family: Archivo, system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 2em; }
.tsg-prose h2 { font-size: 2rem; } .tsg-prose h3 { font-size: 1.5rem; } .tsg-prose h4 { font-size: 1.25rem; }
.tsg-prose a { color: #7BFF8D; text-decoration: underline; text-underline-offset: 0.2em; }
.tsg-prose ul { list-style: square; padding-left: 1.25em; } .tsg-prose ol { list-style: decimal; padding-left: 1.25em; }
.tsg-prose blockquote { border-left: 4px solid #39FF14; padding-left: 1.25em; font-family: Archivo, system-ui, sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.tsg-prose img, .tsg-prose figure { max-width: 100%; height: auto; }
.tsg-prose figcaption { font-family: "DM Mono", monospace; font-size: 0.8rem; color: #84A981; margin-top: 0.5em; }
.tsg-prose code { font-family: "DM Mono", monospace; }
.tsg-prose hr { border-top: 1px solid rgba(132, 169, 129, 0.4); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.screen-reader-text:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100000; background: #39FF14; color: #1B3320; padding: 0.75rem 1rem; font-family: "DM Mono", monospace; }
