/* SkilUpp base: reset, elements, layout primitives, utilities. Requires tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-3);
  color: var(--color-heading);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-heavy);
  line-height: var(--lh-tight);
}
h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-heavy);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h4);
}

p,
ul,
ol,
dl,
figure,
blockquote,
table {
  margin: 0 0 var(--space-4);
}

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

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--color-primary-active);
}

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

button {
  cursor: pointer;
}

hr {
  border: 0;
  border-top: var(--border);
  margin: var(--space-6) 0;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

::selection {
  background: var(--yellow-300);
  color: var(--ink-900);
}

/* Focus: visible for keyboard users on every interactive element */
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.on-dark :focus-visible {
  outline-color: var(--color-focus-on-dark);
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section {
  padding-block: var(--section-pad);
}
.section--tight {
  padding-block: var(--space-6);
}

.stack > * + * {
  margin-top: var(--stack-gap, var(--space-4));
}
.stack > * {
  margin-bottom: 0;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

.grid {
  display: grid;
  gap: var(--grid-gap, var(--space-5));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 240px)), 1fr));
}

.on-dark {
  background: var(--color-dark);
  color: var(--color-on-dark);
}
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4 {
  color: var(--color-on-dark);
}

/* Text utilities */
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lead {
  font-size: var(--fs-lead);
}
.text-muted {
  color: var(--color-text-muted);
}
.text-sm {
  font-size: var(--fs-sm);
}
.text-xs {
  font-size: var(--fs-xs);
}
.text-accent {
  color: var(--color-accent);
}
.text-primary {
  color: var(--color-primary);
}
.script {
  font-family: var(--font-script);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.visually-hidden {
  position: absolute !important;
  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: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--fw-semibold);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  color: var(--color-on-primary);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
