/* ==========================================================================
   GameTagGen — core design system
   Direction: HUD / terminal precision
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* palette */
  --bg-0: #090c0e;
  --bg-1: #0f1417;
  --bg-2: #141a1e;
  --bg-3: #1b2226;
  --line-0: #232b2f;
  --line-1: #2e373c;
  --text-0: #e9f2f4;
  --text-1: #a9b7bc;
  --text-2: #6f7d82;

  --cyan: #00e0ff;
  --cyan-dim: #0a8fa8;
  --cyan-bg: rgba(0, 224, 255, 0.08);
  --amber: #ffb020;
  --amber-dim: #9a6c1a;
  --amber-bg: rgba(255, 176, 32, 0.1);
  --red: #ff5464;
  --red-bg: rgba(255, 84, 100, 0.1);
  --green: #33d17a;

  /* type */
  --font-display: 'Chakra Petch', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* layout */
  --container: 1180px;
  --radius: 3px;
  --header-h: 64px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

@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;
  }
}

/* ---------- base ---------- */
body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(0, 224, 255, 0.05), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(255, 176, 32, 0.04), transparent 35%);
  background-repeat: no-repeat;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-0);
  line-height: 1.15;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.05rem; }

p { color: var(--text-1); }

code, .mono { font-family: var(--font-mono); }

::selection { background: var(--cyan); color: var(--bg-0); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* prompt-style micro label, e.g. "> INPUT" */
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.kicker::before { content: '>'; color: var(--cyan-dim); }

.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .status-dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- bracket-corner panel frame ---------- */
.panel {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line-0);
  border-radius: var(--radius);
  padding: 24px;
}
.panel::before, .panel::after,
.panel > .corner-tl, .panel > .corner-br {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--cyan-dim);
  border-style: solid;
  opacity: 0.7;
}
.panel::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.panel::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

/* scanline overlay, hero sections only */
.scanlines {
  position: relative;
  isolation: isolate;
}
.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  .scanlines::before { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cyan);
  color: #04181c;
  border-color: var(--cyan);
}
.btn-primary:hover { background: #33e8ff; }

.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border-color: var(--line-1);
}
.btn-ghost:hover { border-color: var(--cyan-dim); color: var(--cyan); }

.btn-amber {
  background: var(--amber);
  color: #2b1c02;
  border-color: var(--amber);
}
.btn-amber:hover { background: #ffc04d; }

.btn-sm { padding: 7px 12px; font-size: 0.75rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(9, 12, 14, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-0);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-0);
}
.brand .bracket { color: var(--cyan); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--cyan);
  background: var(--cyan-bg);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text-0);
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line-0);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-0);
  margin-top: 64px;
  padding: 40px 0 32px;
  color: var(--text-2);
  font-size: 0.8rem;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}
.site-footer h4 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-1);
  margin-bottom: 10px;
}
.site-footer ul { display: flex; flex-direction: column; gap: 7px; }
.site-footer a:hover { color: var(--cyan); }
.footer-disclaimer {
  border-top: 1px solid var(--line-0);
  padding-top: 20px;
  line-height: 1.6;
}

/* ---------- hero ---------- */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line-0);
}
.hero .kicker { margin-bottom: 14px; }
.hero h1 { max-width: 780px; margin-bottom: 14px; }
.hero p.lead {
  max-width: 620px;
  font-size: 1rem;
  color: var(--text-1);
}

/* ---------- tool card grid (hub) ---------- */
.section {
  padding: 48px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.section-head h2 { margin: 0; }
.section-head .kicker { margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-0);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), background 0.15s var(--ease);
}
.tool-card:hover {
  border-color: var(--cyan-dim);
  background: var(--bg-2);
}
.tool-card .tool-icon {
  color: var(--cyan);
  font-size: 1.1rem;
}
.tool-card h3 { font-size: 0.98rem; }
.tool-card p {
  font-size: 0.82rem;
  color: var(--text-2);
  margin: 0;
}
.tool-card .tool-tag {
  margin-top: auto;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
}
.badge-pro {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
}
.badge-free {
  background: var(--cyan-bg);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
}

/* ---------- lock note (inline pro teaser) ---------- */
.lock-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-1);
}
.lock-note svg { flex-shrink: 0; color: var(--amber); margin-top: 2px; }
.lock-note strong { color: var(--amber); }

/* ---------- toast ---------- */
#toast-region {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-3);
  border: 1px solid var(--cyan-dim);
  color: var(--text-0);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 7, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  max-width: 400px;
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
}
.modal .status-dot { margin-right: 6px; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.1rem;
  width: 28px; height: 28px;
}
.modal-close:hover { color: var(--cyan); }
.modal h3 { margin-bottom: 10px; }
.modal p { font-size: 0.85rem; margin-bottom: 18px; }

/* ---------- blog ---------- */
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  display: block;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line-0);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.post-card:hover { border-color: var(--cyan-dim); background: var(--bg-2); }
.post-card .post-date { font-size: 0.72rem; color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; }
.post-card h2 { font-size: 1.1rem; margin: 8px 0 6px; }
.post-card p { font-size: 0.85rem; margin: 0; }

.article { max-width: 700px; }
.article .post-date { font-size: 0.75rem; color: var(--text-2); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; display: block; }
.article h1 { margin-bottom: 18px; }
.article h2 { margin: 30px 0 12px; }
.article p { margin-bottom: 14px; font-size: 0.92rem; }
.article ul, .article ol { margin: 0 0 14px 20px; color: var(--text-1); font-size: 0.92rem; }
.article li { margin-bottom: 6px; }
.article a { color: var(--cyan); text-decoration: underline; }

/* ---------- misc utility ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.text-dim { color: var(--text-2); }
