/**
 * AllToolsNow.com - Base Styles & CSS Reset
 */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text-main);
  background-color: var(--color-bg-page);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

html[lang="ja"] {
  font-family: var(--font-sans-ja);
  letter-spacing: 0.02em;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-page);
  color: var(--color-text-main);
}

main {
  flex: 1 0 auto;
}

:focus {
  outline: none;
}

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

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-main);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

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

@media (min-width: 768px) {
  h1 {
    font-size: var(--font-size-4xl);
  }
}

h2 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-8);
}

h3 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-6);
}

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

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

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

strong, b {
  font-weight: 600;
  color: var(--color-text-main);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  color: var(--color-text-secondary);
}

li {
  margin-bottom: var(--space-2);
}

/* Media Safety Defaults - Prevents naked SVG blowups */
img, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

svg:not([width]) {
  width: 24px;
  height: 24px;
}

/* Form Elements */
input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Accessibility Helpers */
.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: #FFFFFF;
  padding: var(--space-2) var(--space-4);
  z-index: 1000;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}

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

/* Gradient Text Helper */
.gradient-text {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 50%, #4338CA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reduced Motion */
@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;
  }
}
