/* ===========================================================================
   Tayfa — base layer
   Reset plus the typographic defaults every page inherits.
   =========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  /* Unitless on purpose. An absolute line-height here (20px) is inherited by
     every descendant, so any text larger than ~20px gets a 20px line box and
     the lines collide. 1.45 lands on the same 20px for 14px body text and
     scales for everything else; the .t-* utilities still pin exact px values
     where the vertical rhythm has to be exact. */
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* Keyboard focus is always visible; mouse focus never draws a ring. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* ---- type utilities --------------------------------------------------- */
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 700; letter-spacing: -.02em; }
.t-h1      { font-size: var(--fs-h1);      line-height: var(--lh-h1);      font-weight: 700; letter-spacing: -.015em; }
.t-h2      { font-size: var(--fs-h2);      line-height: var(--lh-h2);      font-weight: 600; letter-spacing: -.01em; }
.t-h3      { font-size: var(--fs-h3);      line-height: var(--lh-h3);      font-weight: 600; }
.t-body    { font-size: var(--fs-body);    line-height: var(--lh-body); }
.t-strong  { font-size: var(--fs-body);    line-height: var(--lh-body);    font-weight: 600; }
.t-small   { font-size: var(--fs-small);   line-height: var(--lh-small); }
.t-caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; }
.t-micro {
  font-size: var(--fs-micro); line-height: var(--lh-micro);
  font-weight: 700; letter-spacing: .04em;
}

.t-muted  { color: var(--fg-muted); }
.t-subtle { color: var(--fg-subtle); }
.t-accent { color: var(--accent); }
.t-live   { color: var(--live); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; }

.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- scrollbar -------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); background-clip: content-box; }

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