/* =====================================================================
   Matrizon Inc. — STYLE FILE
   Owner: Matrizon Inc. · Matrizon Medium
   Purpose: Dark animated theme, all visuals.
   Mode: DARK ONLY — always on.
   ===================================================================== */

:root {
  --bg:            #050814;
  --bg-2:          #0a1124;
  --card:          #0e1730;
  --card-hover:    #142246;
  --border:        rgba(94, 168, 255, 0.18);
  --text:          #e8eefc;
  --text-dim:      #8fa0c4;
  --text-faint:    #5a6a8a;

  --accent-1:      #5ea8ff;   /* Matrizon blue */
  --accent-2:      #7dd3c0;   /* mint */
  --accent-3:      #ff6b1a;   /* orange */

  --accent-1-soft: rgba(94, 168, 255, 0.14);
  --accent-2-soft: rgba(125, 211, 192, 0.14);
  --accent-3-soft: rgba(255, 107, 26, 0.14);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, #0e1a3a 0%, #050814 45%, #000 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea { font-family: inherit; font-size: inherit; }

/* ===================== ANIMATED STARFIELD ===================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, #cfe3ff, transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent),
    radial-gradient(1px 1px at 80% 50%, #bcd4ff, transparent),
    radial-gradient(1px 1px at 10% 80%, #fff, transparent),
    radial-gradient(1px 1px at 70% 90%, #dbe9ff, transparent),
    radial-gradient(1.2px 1.2px at 50% 50%, #fff, transparent),
    radial-gradient(1px 1px at 30% 10%, #a8c8ff, transparent);
  background-size: 200% 200%;
  animation: drift 60s linear infinite;
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
}

/* ===================== AURORA GLOW ===================== */
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 40%, rgba(80, 140, 255, 0.18), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(255, 107, 26, 0.10), transparent 50%);
  animation: aurora 18s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes drift  { 0% { background-position: 0% 0%; } 100% { background-position: 200% 200%; } }
@keyframes aurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -2%) scale(1.05); }
  100% { transform: translate(-2%, 3%) scale(1.02); }
}

header, nav, main, section, footer, .settings-panel, .toast { position: relative; z-index: 1; }

/* ===================== HEADER ===================== */
.site-header {
  padding: 22px 20px 14px;
  text-align: center;
  position: relative;
  animation: fadeDown 0.9s ease both;
}

.site-title {
  font-size: clamp(22px, 4.5vw, 32px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #7db8ff, #ffffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: shine 6s linear infinite;
}

@keyframes shine { to { background-position: 200% center; } }

.corner-btn {
  position: absolute;
  top: 22px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(20, 30, 60, 0.55);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.corner-btn:hover {
  border-color: var(--accent-1);
  box-shadow: 0 0 22px rgba(94, 168, 255, 0.55);
  transform: translateY(-1px);
}
.corner-btn:active { transform: scale(0.94); }
.corner-btn.left  { left: 20px; }
.corner-btn.right { right: 20px; }

/* ===================== NAV ===================== */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px 20px;
  flex-wrap: wrap;
  animation: fadeDown 1s ease 0.15s both;
}

.nav-link {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-link:hover {
  color: #fff;
  background: rgba(20, 30, 60, 0.55);
  border-color: var(--border);
  box-shadow: 0 0 18px rgba(94, 168, 255, 0.35);
}
.nav-link.active {
  color: #fff;
  background: rgba(94, 168, 255, 0.15);
  border-color: var(--accent-1);
  box-shadow: 0 0 20px rgba(94, 168, 255, 0.5);
}

/* ===================== CONTAINER ===================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
  animation: fadeUp 1s ease 0.3s both;
}
.page-intro {
  text-align: center;
  margin-bottom: 32px;
  color: var(--text-dim);
  font-size: 15px;
}
.page-title {
  text-align: center;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 0 24px rgba(94, 168, 255, 0.45);
}

/* ===================== CARDS ===================== */
.update-card {
  background: rgba(14, 23, 48, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.update-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.update-card:hover {
  border-color: var(--accent-1);
  box-shadow: 0 0 28px rgba(94, 168, 255, 0.35);
  transform: translateY(-2px);
}
.update-card:hover::before { opacity: 1; }
.update-card.special {
  border-color: var(--accent-3);
  background: linear-gradient(135deg, rgba(14, 23, 48, 0.7), rgba(255, 107, 26, 0.1));
}
.update-card.special::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.card-topic {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  flex: 1;
  min-width: 200px;
}
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill-version { background: var(--accent-1-soft); color: var(--accent-1); }
.pill-date    { background: var(--accent-2-soft); color: var(--accent-2); }
.pill-special { background: var(--accent-3-soft); color: var(--accent-3); }

.card-desc {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.card-links {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-links-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(10, 17, 36, 0.7);
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.link-item:hover {
  background: var(--card-hover);
  border-color: var(--accent-2);
  transform: translateX(3px);
  box-shadow: 0 0 18px rgba(125, 211, 192, 0.35);
}
.link-item:active { transform: scale(0.99); }

.link-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-url {
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40%;
}
.link-arrow { color: var(--accent-2); flex-shrink: 0; transition: transform 0.2s ease; }
.link-item:hover .link-arrow { transform: translateX(3px); }

/* ===================== EMPTY ===================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-emoji { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }

/* ===================== ARCHIVE ===================== */
.archive-link {
  display: block;
  text-align: center;
  margin: 30px auto 0;
  padding: 18px 24px;
  max-width: 420px;
  background: rgba(14, 23, 48, 0.6);
  border: 2px dashed var(--accent-1);
  border-radius: var(--radius);
  color: var(--accent-1);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s ease;
}
.archive-link:hover {
  background: var(--accent-1-soft);
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(94, 168, 255, 0.5);
}

/* ===================== SETTINGS ===================== */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.settings-backdrop.open { opacity: 1; pointer-events: auto; }

.settings-panel {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(340px, 88vw);
  background: linear-gradient(180deg, rgba(10, 18, 40, 0.98), rgba(5, 10, 25, 0.99));
  border-right: 1px solid var(--border);
  z-index: 901;
  padding: 24px 20px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(94, 168, 255, 0.2);
}
.settings-panel.open { transform: translateX(0); }

.settings-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 20px rgba(94, 168, 255, 0.5);
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: rgba(20, 30, 60, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.18s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.settings-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent-1);
  box-shadow: 0 0 22px rgba(94, 168, 255, 0.45);
  transform: translateX(3px);
}
.settings-btn:active { transform: scale(0.98); }

.settings-btn-label { display: flex; align-items: center; gap: 12px; }
.settings-btn-icon { font-size: 18px; width: 24px; text-align: center; }
.settings-btn-arrow { color: var(--accent-1); transition: transform 0.2s ease; }
.settings-btn:hover .settings-btn-arrow { transform: translateX(3px); }

.settings-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--accent-1-soft);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-1);
}
.settings-version-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.settings-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 30, 60, 0.6);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  transition: all 0.18s ease;
}
.settings-close:hover {
  background: rgba(255, 107, 26, 0.2);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 107, 26, 0.5);
}

.settings-divider { height: 1px; background: var(--border); margin: 20px 0; }
.settings-footer {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

/* ===================== FOOTER ===================== */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(10px);
}
.site-footer strong { color: var(--text); font-weight: 700; }
.site-footer .heart { color: var(--accent-3); }

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(14, 23, 48, 0.9);
  border: 1px solid var(--accent-2);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 0 30px rgba(125, 211, 192, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 2000;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===================== MOBILE ===================== */
@media (max-width: 600px) {
  .site-header { padding: 20px 16px 12px; }
  .corner-btn { top: 20px; width: 38px; height: 38px; font-size: 16px; }
  .corner-btn.left  { left: 14px; }
  .corner-btn.right { right: 14px; }

  .site-nav {
    gap: 6px;
    padding: 8px 14px 16px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 8px 16px; font-size: 12px; flex-shrink: 0; }

  .container { padding: 0 14px 60px; }
  .update-card { padding: 18px 16px; margin-bottom: 14px; }
  .card-topic { font-size: 16.5px; }
  .link-item { padding: 9px 12px; flex-wrap: wrap; }
  .link-url { max-width: 100%; font-size: 11px; }
  .settings-panel { padding: 20px 16px; }
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(24px); }  to { opacity: 1; transform: translateY(0); } }
