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

html {
  height: 100%;
  overflow: hidden;
  color-scheme: light;
  background: var(--color-paper);
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--color-ink);
  background:
    radial-gradient(circle at 12% 18%, rgb(216 235 230 / 52%), transparent 31rem),
    radial-gradient(circle at 86% 78%, rgb(233 224 237 / 48%), transparent 30rem),
    linear-gradient(145deg, var(--color-paper), var(--color-paper-deep));
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    var(--carino-paper-texture),
    repeating-linear-gradient(0deg, rgb(48 56 59 / 1.5%) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgb(48 56 59 / 1%) 0 1px, transparent 1px 5px);
  background-position: center, center, center;
  background-size: cover, auto, auto;
  content: "";
  opacity: 0.32;
  pointer-events: none;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--color-teal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--color-red);
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 3px;
}

img,
picture,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

figure {
  max-width: 100%;
  margin-inline: 0;
}

h1,
h2,
h3,
h4 {
  margin-block: 0 0.65em;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

p,
ul,
ol,
blockquote {
  margin-block: 0 1em;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 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;
}

.screen-reader-text:focus {
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000000;
  width: auto !important;
  height: auto !important;
  padding: var(--space-2) var(--space-3) !important;
  margin: 0 !important;
  clip: auto !important;
  color: var(--color-ink);
  background: var(--color-white);
  border: 2px solid var(--color-teal);
  border-radius: var(--radius-small);
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--color-ink);
  background: var(--color-gold-soft);
}

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

@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid Highlight;
  }

  button,
  .button,
  .wp-element-button,
  .view-panel,
  .reader-panel,
  .work-card,
  .post-card {
    border: 1px solid CanvasText;
  }
}
