/* GEKUMI base typography and layout primitives. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--gekumi-color-background);
  color: var(--gekumi-color-primary);
  font-family: var(--gekumi-font-latin);
  font-size: var(--gekumi-font-size-body);
  line-height: var(--gekumi-line-height-body);
  text-rendering: optimizeLegibility;
}

:lang(ja) {
  font-family: var(--gekumi-font-ja-sans);
  line-height: var(--gekumi-line-height-cjk);
}

:lang(ko) {
  font-family: var(--gekumi-font-ko);
  line-height: var(--gekumi-line-height-cjk);
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

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

a {
  color: inherit;
}

:where(main section[id], main article[id]) {
  scroll-margin-block-start: 8rem;
}

:focus-visible {
  outline: 2px solid var(--gekumi-color-info);
  outline-offset: 3px;
  box-shadow: var(--gekumi-control-focus-ring);
}

h1,
h2,
h3,
h4,
.gekumi-heading-1,
.gekumi-heading-2,
.gekumi-heading-3,
.gekumi-heading-4 {
  margin-block: 0;
  font-weight: var(--gekumi-font-weight-semibold);
  letter-spacing: var(--gekumi-letter-spacing-heading);
  line-height: var(--gekumi-line-height-heading);
  text-wrap: balance;
}

h1,
.gekumi-heading-1 {
  font-size: var(--gekumi-font-size-h1);
}

h2,
.gekumi-heading-2 {
  font-size: var(--gekumi-font-size-h2);
}

h3,
.gekumi-heading-3 {
  font-size: var(--gekumi-font-size-h3);
}

h4,
.gekumi-heading-4 {
  font-size: var(--gekumi-font-size-h4);
}

.gekumi-heading--editorial:lang(ja) {
  font-family: var(--gekumi-font-ja-serif);
  font-weight: var(--gekumi-font-weight-medium);
}

:is(h1, h2, h3, h4, .gekumi-heading-1, .gekumi-heading-2, .gekumi-heading-3, .gekumi-heading-4):is(:lang(ja), :lang(ko)) {
  letter-spacing: normal;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

p {
  margin-block: 0;
}

.gekumi-body-large {
  font-size: var(--gekumi-font-size-body-large);
  line-height: var(--gekumi-line-height-body);
}

.gekumi-body-small {
  font-size: var(--gekumi-font-size-body-small);
}

.gekumi-caption {
  color: var(--gekumi-color-muted-text);
  font-size: var(--gekumi-font-size-caption);
  font-weight: var(--gekumi-font-weight-medium);
  letter-spacing: var(--gekumi-letter-spacing-label);
  line-height: var(--gekumi-line-height-compact);
}

.gekumi-spec-label {
  color: var(--gekumi-color-text-subtle);
  font-size: var(--gekumi-font-size-spec-label);
  font-weight: var(--gekumi-font-weight-semibold);
  letter-spacing: var(--gekumi-letter-spacing-label);
  line-height: var(--gekumi-line-height-compact);
  text-transform: uppercase;
}

:is(.gekumi-spec-label):is(:lang(ja), :lang(ko)) {
  letter-spacing: normal;
  text-transform: none;
}

.gekumi-spec-value {
  font-size: var(--gekumi-font-size-spec-value);
  font-weight: var(--gekumi-font-weight-medium);
  line-height: var(--gekumi-line-height-compact);
}

:is(.gekumi-button, .gekumi-tab, .gekumi-primary-nav a, .gekumi-header-link, .gekumi-spec-label):is(:lang(ja), :lang(ko)) {
  letter-spacing: normal;
  overflow-wrap: anywhere;
  text-transform: none;
}

.gekumi-spec-value,
.gekumi-animal-card__eyebrow,
code {
  font-variant-numeric: tabular-nums;
}

.gekumi-container,
.gekumi-container--wide {
  inline-size: min(100%, var(--gekumi-container-standard));
  margin-inline: auto;
  padding-inline: var(--gekumi-container-gutter);
}

.gekumi-container--wide {
  inline-size: min(100%, var(--gekumi-container-wide));
}

.gekumi-grid {
  display: grid;
  grid-template-columns: repeat(var(--gekumi-grid-columns-desktop), minmax(0, 1fr));
  gap: var(--gekumi-grid-gap);
}

.gekumi-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gekumi-space-6);
}

.gekumi-section {
  padding-block: clamp(var(--gekumi-space-16), 8vw, var(--gekumi-space-24));
}

.gekumi-visually-hidden {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
