/**
 * GoTryTech Premium Base & Reset Styling
 * 
 * Part of Phase 2 UI Redesign. Established CSS Reset, Typography, Accessibility, 
 * Selection Highlight, and Scrollbar styling using Design Token custom properties.
 */

/* ==========================================================================
   1. MODERN CSS RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

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

/* ==========================================================================
   2. BODY & CANVAS
   ========================================================================== */
body {
  background-color: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  transition: background-color var(--duration-theme) var(--ease-in-out),
              color var(--duration-theme) var(--ease-in-out);
  overflow-x: hidden;
}

/* ==========================================================================
   3. TYPOGRAPHY & HEADINGS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  transition: color var(--duration-theme) var(--ease-in-out);
}

h1 {
  font-size: var(--text-display-lg);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-snug);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-5);
  line-height: var(--leading-relaxed);
}

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

a {
  color: var(--green-500);
  text-decoration: none;
  font-weight: var(--weight-medium);
  transition: var(--transition-color);
}

a:hover {
  color: var(--green-400);
}

a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

/* Inline Code Element */
code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-code);
  background-color: var(--green-muted);
  border: 1px solid var(--green-border);
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   4. ACCESSIBILITY & SKIP TO CONTENT LINK
   ========================================================================== */
.gtt-skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-5);
  background: var(--green-500);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-button);
  font-weight: var(--weight-bold);
  z-index: var(--z-top);
  box-shadow: var(--shadow-lg);
  transition: top var(--duration-normal) var(--ease-out);
}

.gtt-skip-link:focus {
  top: var(--space-5);
  outline: none;
}

/* ==========================================================================
   5. SELECTION COLOR
   ========================================================================== */
::selection {
  background-color: var(--green-300);
  color: var(--text-inverse);
}

/* ==========================================================================
   6. PREMIUM SYSTEM SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-500);
}
