/* ==========================================================================
   base.css - reset, tipografi tabani, doku, erisilebilirlik temelleri
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  background: var(--bh-paper);
  color: var(--bh-ink);
  font-family: var(--bh-font-body);
  font-size: var(--bh-text-body);
  line-height: var(--bh-leading-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition:
    background-color var(--bh-duration-normal) var(--bh-ease-out),
    color var(--bh-duration-normal) var(--bh-ease-out);
}

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

img {
  height: auto;
}

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--bh-font-display);
  font-weight: 800;
  line-height: var(--bh-leading-heading);
  letter-spacing: var(--bh-tracking-display);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--bh-spot);
  color: var(--bh-spot-fg);
}

/* --------------------------------------------------------------------------
   Focus - her odaklanabilir ogede gorunur, vurgu renginde
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--bh-spot);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Grain - sabit overlay. Asla kaydirilan konteynere uygulanmaz, aksi halde
   her scroll karesinde GPU repaint olur ve mobilde FPS coker.
   -------------------------------------------------------------------------- */

.bh-grain {
  position: fixed;
  inset: 0;
  z-index: var(--bh-z-grain);
  pointer-events: none;
  background-image: url("../img/grain.png");
  background-repeat: repeat;
  opacity: 0.05;
  mix-blend-mode: multiply;
}

:root[data-theme="dark"] .bh-grain {
  mix-blend-mode: screen;
  opacity: 0.035;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bh-grain {
    mix-blend-mode: screen;
    opacity: 0.035;
  }
}

/* --------------------------------------------------------------------------
   Erisilebilirlik yardimcilari
   -------------------------------------------------------------------------- */

.bh-skip-link {
  position: fixed;
  left: 0.75rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  background: var(--bh-spot);
  color: var(--bh-spot-fg);
  font-weight: 600;
  border-radius: var(--bh-radius-button);
  transition: top var(--bh-duration-fast) var(--bh-ease-out);
}

.bh-skip-link:focus {
  top: 0.75rem;
}

.bh-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Reduced motion - tum sure bazli hareket kapanir
   -------------------------------------------------------------------------- */

@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;
    scroll-behavior: auto !important;
  }
}
