/*
Theme Name: Mervixa
Theme URI: https://mervixa.org
Author: r1hub
Description: Custom-built one-page-style theme for the Mervixa sci-fi fleet strategy game. Hex-grid star-chart aesthetic, built for NL audience.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: mervixa
*/

/* ==========================================================================
   0. DESIGN TOKENS
   Void Navy    #0D1226  — primary background (deep space)
   Navy Deep    #080B18  — footer / darkest panels
   Parchment    #EFE6D0  — light "star-chart paper" panels
   Ink          #1B1B22  — text on parchment
   Plasma Amber #F2A65A  — primary accent (CTAs, highlights)
   Ion Teal     #3FA9A0  — secondary accent (links, plot lines)
   Alert Crimson#C1443A  — rare use: warnings / important CTA emphasis
   Mist         #9AA3C2  — muted text on navy
   ========================================================================== */

:root{
  --void: #0D1226;
  --void-deep: #080B18;
  --parchment: #EFE6D0;
  --ink: #1B1B22;
  --amber: #F2A65A;
  --teal: #3FA9A0;
  --crimson: #C1443A;
  --mist: #9AA3C2;

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Newsreader", "Georgia", serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius: 2px;
  --plate-cut: 18px; /* clipped-corner size for "chart-plate" panels */
  --maxw: 1180px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--void);
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
a{ color: var(--teal); text-decoration: none; }
a:hover{ color: var(--amber); }

:focus-visible{
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

h1, h2, h3, h4{
  font-family: var(--font-display);
  color: #F5F2E8;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1{ font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 700; }
h2{ font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; }
h3{ font-size: 1.3rem; font-weight: 600; }
p{ margin: 0 0 1.1em; }

.eyebrow{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.9em;
}
.eyebrow::before{
  content: "";
  width: 22px; height: 1px;
  background: var(--amber);
  display: inline-block;
}

.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section{ padding: 96px 0; position: relative; }
.section--tight{ padding: 64px 0; }
.section--parchment{ background: var(--parchment); color: var(--ink); }
.section--parchment h2, .section--parchment h3{ color: var(--ink); }
.section--deep{ background: var(--void-deep); }

/* Hex-grid ambient texture, used as background layer */
.hexfield{
  position: absolute; inset: 0;
  background-image:
    linear-gradient(30deg, rgba(63,169,160,0.06) 12%, transparent 12.5%, transparent 87%, rgba(63,169,160,0.06) 87.5%, rgba(63,169,160,0.06)),
    linear-gradient(150deg, rgba(63,169,160,0.06) 12%, transparent 12.5%, transparent 87%, rgba(63,169,160,0.06) 87.5%, rgba(63,169,160,0.06)),
    linear-gradient(30deg, rgba(63,169,160,0.06) 12%, transparent 12.5%, transparent 87%, rgba(63,169,160,0.06) 87.5%, rgba(63,169,160,0.06)),
    linear-gradient(150deg, rgba(63,169,160,0.06) 12%, transparent 12.5%, transparent 87%, rgba(63,169,160,0.06) 87.5%, rgba(63,169,160,0.06));
  background-size: 46px 80px;
  background-position: 0 0, 0 0, 23px 40px, 23px 40px;
  pointer-events: none;
  opacity: 0.7;
}

/* ==========================================================================
   1. HEADER / NAV
   ========================================================================== */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,18,38,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(154,163,194,0.15);
}
.site-header .wrap{
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand{
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.3rem;
  color: #F5F2E8;
  display: flex; align-items: center; gap: 10px;
}
.brand__mark{
  width: 28px; height: 28px;
  background: conic-gradient(from 45deg, var(--amber), var(--teal), var(--amber));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.main-nav ul{ list-style: none; display: flex; gap: 32px; margin: 0; padding: 0; }
.main-nav a{
  font-family: var(--font-mono); font-size: 0.85rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--mist);
}
.main-nav a:hover, .main-nav a.current{ color: var(--amber); }
.nav-toggle{ display: none; background: none; border: 1px solid var(--mist); color: #F5F2E8; padding: 8px 10px; }

@media (max-width: 860px){
  .main-nav{ display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--void-deep); border-bottom: 1px solid rgba(154,163,194,0.15); }
  .main-nav.is-open{ display: block; }
  .main-nav ul{ flex-direction: column; gap: 0; padding: 12px 24px 24px; }
  .main-nav li{ padding: 12px 0; border-bottom: 1px solid rgba(154,163,194,0.1); }
  .nav-toggle{ display: inline-block; }
}

/* ==========================================================================
   2. BUTTONS
   ========================================================================== */
.btn{
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 15px 28px;
  border: 1px solid var(--amber);
  color: var(--amber);
  background: transparent;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn:hover{ background: var(--amber); color: var(--void-deep); }
.btn--solid{ background: var(--amber); color: var(--void-deep); }
.btn--solid:hover{ background: #ffbc76; color: var(--void-deep); }
.btn--ghost{ border-color: var(--mist); color: var(--mist); }
.btn--ghost:hover{ border-color: var(--teal); color: var(--void-deep); background: var(--teal); }

/* ==========================================================================
   3. HERO — signature star-chart element
   ========================================================================== */
.hero{
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 20%, rgba(63,169,160,0.16), transparent 55%), var(--void);
}
.hero .wrap{
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  position: relative; z-index: 2;
}
.hero__lead{ font-size: 1.15rem; color: var(--mist); max-width: 46ch; margin-bottom: 2em; }
.hero__cta{ display: flex; gap: 16px; flex-wrap: wrap; }
.hero__chart{ position: relative; aspect-ratio: 1/1; }
.hero__chart svg{ width: 100%; height: 100%; }
.chart-line{ stroke: var(--teal); stroke-width: 1; fill: none; opacity: 0.55; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s ease forwards; }
.chart-node{ fill: var(--amber); opacity: 0; animation: fadeIn 0.6s ease forwards; }
@keyframes draw{ to{ stroke-dashoffset: 0; } }
@keyframes fadeIn{ to{ opacity: 1; } }

@media (max-width: 900px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .hero__chart{ order: -1; max-width: 320px; margin: 0 auto; }
}

/* ==========================================================================
   4. CHART-PLATE PANELS (cards)
   ========================================================================== */
.plate{
  background: rgba(239,230,208,0.04);
  border: 1px solid rgba(154,163,194,0.2);
  padding: 32px;
  clip-path: polygon(0 0, calc(100% - var(--plate-cut)) 0, 100% var(--plate-cut), 100% 100%, var(--plate-cut) 100%, 0 calc(100% - var(--plate-cut)));
  position: relative;
}
.plate__num{ font-family: var(--font-mono); color: var(--amber); font-size: 0.8rem; letter-spacing: 0.08em; }
.section--parchment .plate{ background: #fff; border-color: rgba(27,27,34,0.12); }

.grid{ display: grid; gap: 24px; }
.grid--3{ grid-template-columns: repeat(3, 1fr); }
.grid--2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .grid--3, .grid--2{ grid-template-columns: 1fr; } }

/* ==========================================================================
   5. REVIEWS
   ========================================================================== */
.review{ display: flex; flex-direction: column; gap: 14px; }
.review__stars{ font-family: var(--font-mono); color: var(--amber); letter-spacing: 0.1em; }
.review__author{ font-family: var(--font-display); font-weight: 600; color: #F5F2E8; }
.section--parchment .review__author{ color: var(--ink); }
.review__role{ font-family: var(--font-mono); font-size: 0.78rem; color: var(--mist); text-transform: uppercase; letter-spacing: 0.05em; }

/* ==========================================================================
   6. FORMS
   ========================================================================== */
.form-row{ margin-bottom: 20px; }
.form-row label{ display: block; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; color: var(--mist); }
.section--parchment .form-row label{ color: var(--ink); }
.form-row input, .form-row textarea, .form-row select{
  width: 100%; padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(154,163,194,0.3);
  color: #F5F2E8; font-family: var(--font-body); font-size: 1rem;
  border-radius: var(--radius);
}
.section--parchment .form-row input, .section--parchment .form-row textarea, .section--parchment .form-row select{
  background: #fff; color: var(--ink); border-color: rgba(27,27,34,0.2);
}
.form-row textarea{ min-height: 140px; resize: vertical; }
.form-note{ font-size: 0.85rem; color: var(--mist); }

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer{ background: var(--void-deep); padding: 64px 0 32px; border-top: 1px solid rgba(154,163,194,0.15); }
.footer-grid{ display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid h4{ color: var(--amber); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.footer-grid ul{ list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom{ display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid rgba(154,163,194,0.1); font-size: 0.85rem; }
@media (max-width: 700px){ .footer-grid{ grid-template-columns: 1fr; } }

/* ==========================================================================
   8. BLOG
   ========================================================================== */
.post-card{ display: flex; flex-direction: column; gap: 12px; }
.post-card__meta{ font-family: var(--font-mono); font-size: 0.75rem; color: var(--teal); text-transform: uppercase; letter-spacing: 0.06em; }
.post-card h3 a{ color: #F5F2E8; }
.section--parchment .post-card h3 a{ color: var(--ink); }
.single-post .entry-content{ max-width: 72ch; }
.single-post .entry-content h2{ margin-top: 1.4em; }

/* ==========================================================================
   9. UTILITIES
   ========================================================================== */
.text-center{ text-align: center; }
.mx-auto{ margin-left: auto; margin-right: auto; }
.mb-0{ margin-bottom: 0; }
.stat-row{ display: flex; gap: 40px; flex-wrap: wrap; margin-top: 2em; }
.stat{ font-family: var(--font-mono); }
.stat b{ display: block; font-size: 2rem; color: var(--amber); font-family: var(--font-display); }
.skip-link{ position: absolute; left: -9999px; top: 0; background: var(--amber); color: var(--void-deep); padding: 10px 16px; z-index: 100; }
.skip-link:focus{ left: 16px; top: 16px; }
