/* ============================================
   TOS Network - Base Styles
   Reset, typography, and global styles
   ============================================ */

/* ============ CSS Reset ============ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: #07020f;
  overflow-x: hidden;
  position: relative;
}

/* Modern gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    /* 45deg red gradient - top left */
    linear-gradient(45deg, #e44b44 -50%, rgba(7, 2, 15, 0) 20%),
    /* 135deg green gradient - top right */
    linear-gradient(135deg, #03ca9b -50%, rgba(7, 2, 15, 0) 20%),
    /* 90deg horizontal fade */
    linear-gradient(90deg, #07020f 10%, rgba(7, 2, 15, 0) 50%),
    /* Base color */
    #0d1d29;
  pointer-events: none;
  z-index: 0;
}

/* ============ Typography ============ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin: 0;
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-4xl);
}

h3 {
  font-size: var(--font-size-3xl);
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

p {
  margin: 0;
  margin-bottom: var(--spacing-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary-blue-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-cyan);
}

a:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

strong, b {
  font-weight: var(--font-weight-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--font-size-sm);
}

ul, ol {
  margin: 0;
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-sm);
}

li:last-child {
  margin-bottom: 0;
}

/* ============ Layout Containers ============ */

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

.section {
  padding: var(--section-spacing-y) 0;
}

/* ============ Utility Classes ============ */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
}

.btn:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.btn-primary {
  color: var(--white);
  background: var(--btn-gradient-primary);
  box-shadow: 0 4px 15px var(--primary-blue-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

/* ============ Scrollbar Styling ============ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 144, 226, 0.5);
}

/* ============ Selection Styling ============ */

::selection {
  background-color: var(--primary-blue);
  color: var(--white);
}

::-moz-selection {
  background-color: var(--primary-blue);
  color: var(--white);
}

/* ============ Focus Visible ============ */

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

/* ============ Accessibility ============ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--primary-blue);
  color: var(--white);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  z-index: var(--z-top);
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: var(--spacing-md);
}

/* ============ Image Styling ============ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  display: inline-block;
  vertical-align: middle;
}

/* ============ Form Elements ============ */

button {
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ============ Loading States ============ */

[aria-busy="true"] {
  cursor: progress;
}

/* ============ Hidden Elements ============ */

[hidden] {
  display: none !important;
}

/* ============ Smooth Scrolling ============ */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

/* ============ Print Styles ============ */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3,
  p {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
