/* Base CSS Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--pocket-font);
  background-color: var(--pocket-background);
  color: var(--pocket-text);
  line-height: 1.7;
  font-size: 1.0625rem; /* 17px base for enhanced Chinese legibility */
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Soft Atmosphere */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: 
    radial-gradient(circle at 12% 15%, rgba(255, 198, 174, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 88% 25%, rgba(189, 222, 250, 0.22) 0%, transparent 40%),
    radial-gradient(circle at 50% 70%, rgba(247, 217, 130, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(217, 204, 250, 0.16) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--pocket-heading);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 3.8vw, 3.25rem); }
h2 { font-size: clamp(1.65rem, 2.6vw, 2.35rem); }
h3 { font-size: clamp(1.3rem, 1.9vw, 1.65rem); }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.2em;
}

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

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

a:hover {
  color: var(--pocket-primary-dark);
}

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

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

/* Accessible Skip Links */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--pocket-primary);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--pocket-radius-md);
  z-index: 9999;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 20px;
  outline: 3px solid var(--pocket-yellow);
}

/* Focus Ring */
:focus-visible {
  outline: 3px solid var(--pocket-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
