/* ==========================================================================
   TSG AI - Base Styles / Reset / Typography
   ========================================================================== */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--tsg-black);
  background-color: var(--tsg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--tsg-black);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}

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

h4 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-4);
  color: var(--tsg-gray-700);
}

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

a {
  color: var(--tsg-teal);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--tsg-teal-dark);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--tsg-teal);
  outline-offset: 2px;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--tsg-teal);
  color: var(--tsg-white);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  z-index: calc(var(--z-loader) + 1);
  transition: top var(--duration-fast) ease;
}

.skip-link:focus {
  top: var(--space-4);
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* Prevents iOS zoom on focus */
}

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

/* Selection color */
::selection {
  background-color: var(--tsg-teal-light);
  color: var(--tsg-black);
}
