/* GLYPH RP - Global Stylesheet
   Loaded after Bootstrap for overrides
   See CSS-ORGANIZATION.md for structure */

/* ==========================================
   FONTS & VARIABLES
   ========================================== */

@font-face {
  font-family: "Marcellus";
  src: url("../assets/fonts/Marcellus-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Theme Colors */
  --color-accent-light: #07ebec;
  --color-accent: #20a2a6;
  --color-accent-dark: #3966aa;
  --color-secondary-light: #3b1c7a;
  --color-secondary-dark: #2a1157;
  --color-divider: #ddcf92;
  --color-bg: #2d2d2d;
  --color-text: #f1f1f1;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: rgba(241, 241, 241, 0.75);

  /* Typography Scale (Desktop: 16px base) */
  --base-font-size: 16px;
  --scale-h1: 2.5rem;
  --scale-h2: 2rem;
  --scale-h3: 1.75rem;
  --scale-h4: 1.5rem;
  --scale-h5: 1.25rem;
  --scale-h6: 1rem;
  --scale-body: 1rem;
  --scale-small: 0.875rem;
  --scale-lead: 1.25rem;

  /* Line Heights */
  --line-height-heading: 1.2;
  --line-height-body: 1.6;

  /* Spacing & Families */
  --content-spacing: 2rem;
  --font-heading: "Marcellus", "Georgia", serif;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Mobile/Tablet Typography (0px - 991.98px, 15px base) */
@media (max-width: 991.98px) {
  :root {
    --base-font-size: 15px;
    --scale-h1: 1.875rem;
    --scale-h2: 1.625rem;
    --scale-h3: 1.5rem;
    --scale-h4: 1.375rem;
    --scale-h5: 1.1875rem;
    --scale-h6: 1rem;
    --scale-body: 0.9375rem;
    --scale-small: 0.8438rem;
    --scale-lead: 1.0625rem;
    --line-height-body: 1.5;
  }
  html {
    font-size: 15px;
  }
}

/* 2K+ Typography (1400px+, 18px base) */
@media (min-width: 1400px) {
  :root {
    --base-font-size: 18px;
    --scale-h1: 3rem;
    --scale-h2: 2.5rem;
    --scale-h3: 2.125rem;
    --scale-h4: 1.75rem;
    --scale-h5: 1.5rem;
    --scale-h6: 1.25rem;
    --scale-body: 1.125rem;
    --scale-small: 1rem;
    --scale-lead: 1.5rem;
  }
  html {
    font-size: 18px;
  }
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1 {
  color: var(--color-text);
  font-size: var(--scale-h1);
  line-height: var(--line-height-heading);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h2 {
  color: var(--color-text);
  font-size: var(--scale-h2);
  line-height: var(--line-height-heading);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h3 {
  color: var(--color-text);
  font-size: var(--scale-h3);
  line-height: var(--line-height-heading);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h4 {
  color: var(--color-text);
  font-size: var(--scale-h4);
  line-height: var(--line-height-heading);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h5 {
  color: var(--color-text);
  font-size: var(--scale-h5);
  line-height: var(--line-height-heading);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h6 {
  color: var(--color-text);
  font-size: var(--scale-h6);
  line-height: var(--line-height-heading);
  font-weight: 500;
  font-family: var(--font-heading);
  letter-spacing: 0;
}

body {
  color: var(--color-text);
  font-size: var(--scale-body);
  line-height: var(--line-height-body);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.01em;
  background: transparent;
}

body *:not(a):not(a *) {
  color: inherit;
}

p {
  color: var(--color-text);
  font-size: var(--scale-body);
  line-height: var(--line-height-body);
}

.text-color {
  color: var(--color-text);
}

.text-color-light {
  color: var(--color-text-muted);
}

.lead, p.lead {
  font-size: var(--scale-lead);
  font-weight: 300;
  line-height: var(--line-height-body);
}

small, .small {
  font-size: var(--scale-small);
  line-height: var(--line-height-body);
}

code, pre {
  font-size: calc(var(--scale-body) * 0.875);
}

ul, ol {
  font-size: var(--scale-body);
  line-height: var(--line-height-body);
}

li {
  color: var(--color-text);
}

/* ==========================================
   LINKS
   ========================================== */

a {
  color: var(--color-accent-light);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-light);
  transition: color 0.2s ease, text-decoration-color 0.2s ease, text-shadow 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-accent-dark);
  text-decoration-color: var(--color-accent-dark);
}

a:active {
  color: var(--color-accent-light);
  text-decoration-color: var(--color-accent-light);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
               0 0 12px rgba(255, 255, 255, 0.6),
               0 0 16px rgba(255, 255, 255, 0.4);
}

a:focus-visible {
  outline: 2px solid var(--color-divider);
  outline-offset: 2px;
}

a.link-external {
  color: var(--color-divider);
  text-decoration-style: none;
  text-decoration-color: var(--color-divider);
}

a.link-external:hover,
a.link-external:focus {
  color: var(--color-accent-light);
  text-decoration-color: var(--color-accent-light);
}

a.link-external:active {
  color: var(--color-divider);
  text-decoration-color: var(--color-divider);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
               0 0 12px rgba(255, 255, 255, 0.6),
               0 0 16px rgba(255, 255, 255, 0.4);
}

/* ==========================================
   HEADERS
   ========================================== */

.h1 { font-size: var(--scale-h1); font-family: var(--font-heading); }
.h2 { font-size: var(--scale-h2); font-family: var(--font-heading); }
.h3 { font-size: var(--scale-h3); font-family: var(--font-heading); }
.h4 { font-size: var(--scale-h4); font-family: var(--font-heading); }
.h5 { font-size: var(--scale-h5); font-family: var(--font-heading); }
.h6 { font-size: var(--scale-h6); font-family: var(--font-heading); }

.display-1 {
  font-size: calc(var(--scale-h1) * 1.6);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

.display-2 {
  font-size: calc(var(--scale-h1) * 1.4);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

.display-3 {
  font-size: calc(var(--scale-h1) * 1.2);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

.display-4 {
  font-size: var(--scale-h1);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

.display-5 {
  font-size: var(--scale-h2);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

.display-6 {
  font-size: var(--scale-h3);
  font-weight: 300;
  line-height: var(--line-height-heading);
  font-family: var(--font-heading);
}

/* ==========================================
   LAYOUT & STRUCTURE
   ========================================== */

html {
  background-image: url("../assets/images/bg-dark-mosaic.png");
  background-repeat: repeat;
  background-color: var(--color-bg);
}

img {
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
}

main.site-main {
  margin-top: clamp(0.75rem, 2vh, 2rem);
  background-image: url("../assets/images/bg-cartographer.png");
  border-radius: 24px;
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
  position: relative;
}

main.site-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--main-subsection-color, transparent) 0%,
    var(--main-subsection-color, transparent) 10%,
    rgba(0, 0, 0, 0) 33%,
    rgba(0, 0, 0, 0) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

main.site-main > * {
  position: relative;
  z-index: 1;
}

/* Main content animations */
html.js-main-animate main.site-main > *:not(.hero-wrapper) {
  animation: slideInUp 0.75s ease-out;
}

html.js-main-animate main.site-main .hero-header .container {
  animation: slideInUp 0.75s ease-out;
}

html.js-main-animate main.site-main .hero-wrapper {
  animation: heroFadeIn 0.6s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Full-width sections breaking out of main padding */
main.site-main > section.container-fluid {
  margin-left: calc(-1 * var(--site-main-padding));
  margin-right: calc(-1 * var(--site-main-padding));
  max-width: none;
  width: calc(100% + (var(--site-main-padding) * 2));
}

main.site-main > section.container-fluid:first-child {
  margin-top: calc(-1 * var(--site-main-padding));
}

/* Desktop layout (992px+) */
@media (min-width: 992px) {
  main.site-main {
    width: calc(100vw - 8rem);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
  main.site-main.full-width {
    max-width: 95%;
  }
}

/* Mobile/Tablet adjustments (0px - 991.98px) */
@media (max-width: 991.98px) {
  main.site-main {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    border-radius: 16px;
  }
  body {
    padding-top: calc(var(--navbar-height) + 0.5rem);
  }
  main > .container:not(section),
  main > .container-fluid:not(section) {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ==========================================
   UTILITIES & COMPONENTS
   ========================================== */

.glass-panel {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.btn-cta {
  width: 40vw;
  max-width: 400px;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.server-header {
  background-color: var(--color-secondary-light);
  color: var(--color-text);
}

.server-header-title {
  color: var(--color-text);
  margin-bottom: 0;
}

.server-stat-group {
  border-bottom: 1px solid var(--color-text-secondary);
  padding-bottom: 0.5rem;
  color: var(--color-text);
}

.server-stat-value {
  color: #ffffff;
  font-weight: 600;
}

.server-stat-icon {
  color: var(--color-divider);
}

/* Card optimization for mobile */
@media (max-width: 991.98px) {
  .card-body {
    padding: 0.75rem;
  }
  .card-header {
    padding: 0.5rem 0.75rem;
  }
  .card-footer {
    padding: 0.5rem 0.75rem;
  }
  .row {
    --bs-gutter-y: 0.75rem;
  }
  .container.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* Image with crisp white outline border */
.img-outline {
  filter: drop-shadow(0.0625rem 0 0 rgba(255, 255, 255, 0.75))
          drop-shadow(-0.0625rem 0 0 rgba(255, 255, 255, 0.75))
          drop-shadow(0 0.0625rem 0 rgba(255, 255, 255, 0.75))
          drop-shadow(0 -0.0625rem 0 rgba(255, 255, 255, 0.75))
          drop-shadow(0.0625rem 0.0625rem 0 rgba(255, 255, 255, 0.75))
          drop-shadow(-0.0625rem -0.0625rem 0 rgba(255, 255, 255, 0.75))
          drop-shadow(0.0625rem -0.0625rem 0 rgba(255, 255, 255, 0.75))
          drop-shadow(-0.0625rem 0.0625rem 0 rgba(255, 255, 255, 0.75));
}

/* Image with black drop shadow */
.img-shadow {
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5))
          drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.5))
          drop-shadow(2px -2px 4px rgba(0, 0, 0, 0.5))
          drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.5));
}

/* Shake animation for interactive elements */
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-1deg); }
  20%, 40%, 60%, 80% { transform: rotate(1deg); }
}

.img-shake {
  transition: transform 0.2s ease;
  cursor: default;
}

.img-shake:hover {
  animation: shake 1.2s ease-in-out;
}

/* ==========================================
   BOOTSTRAP ACCORDION OVERRIDES
   ========================================== */

/* Global accordion item - no border by default */
.accordion-item {
  background: transparent;
  border: none;
}

/* Global accordion button styling */
.accordion-button {
  background: transparent;
  color: var(--color-text);
  border: none;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  outline: none;
  border-color: transparent;
}

/* FontAwesome chevron icon for accordions */
.accordion-button::after {
  content: '\f078';
  font-family: FontAwesome;
  font-size: 1rem;
  color: var(--color-text);
  transition: transform 0.2s ease-in-out;
  flex-shrink: 0;
  background-image: none;
  width: auto;
  height: auto;
}

.accordion-button:not(.collapsed)::after {
  transform: rotate(-180deg);
}

/* Accordion body styling */
.accordion-body {
  color: var(--color-text);
}
