/*
 * Homepage base styles.
 *
 * Moved equivalently from index.html during HOMEUX-Step 3. Keep this file
 * limited to element defaults, document-level behavior, and accessibility
 * primitives that should load before layout and component rules.
 */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: max(14px, env(safe-area-inset-top));
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(189, 139, 56, .18), transparent 26rem),
    radial-gradient(circle at 96% 12%, rgba(36, 79, 91, .14), transparent 28rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 55%, #efe7db 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.75;
  letter-spacing: .015em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

button, input { font: inherit; }

button, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(36, 79, 91, .14);
}

h1, h2, h3, p, strong, small, span { overflow-wrap: anywhere; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

:target { scroll-margin-top: 18px; }

#library-root:focus { outline: none; }

#library-root:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
  border-radius: var(--home-radius-lg);
}

.skip-link {
  position: absolute;
  left: 14px;
  top: 10px;
  z-index: 20;
  transform: translateY(-160%);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: #244f5b;
  color: #fffaf0;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(36,79,91,.22);
  transition: transform .16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
