/* =========================================================================
   Bilhan Tekstil — Core styles (reset, typography, primitives)
   Requires tokens.css
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg, canvas { display: block; max-width: 100%; }
picture { display: contents; }   /* <picture> wrappers from the image pipeline must not change layout */
img, video { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--selection); }

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

.skip-link {
  position: fixed; left: var(--sp-4); top: var(--sp-4); z-index: var(--z-loader);
  padding: var(--sp-3) var(--sp-4); background: var(--fg); color: var(--bg);
  transform: translateY(-200%); transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); background: var(--bg); color: var(--fg); }

/* ---------- Typography ---------- */
.display, .h-hero, .h-d1, .h-d2, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 350;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  margin: 0;
  text-wrap: balance;
  font-feature-settings: "liga", "dlig", "kern";
}
.h-hero { font-size: var(--fs-hero); font-weight: 300; }
.h-d1 { font-size: var(--fs-d1); font-weight: 300; }
.h-d2 { font-size: var(--fs-d2); }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-snug); }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); font-weight: 500; }
.display em, .h-hero em, .h-d1 em, .h-d2 em, .h1 em, .h2 em { font-style: italic; color: var(--accent); }

.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--fg-subtle); max-width: var(--measure); font-weight: 300; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }

.label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.label--accent { color: var(--accent); }

.numeral {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: .9;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.03em;
}

/* ---------- Thread link ---------- */
.link-thread {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
  transition: background-size var(--dur-base) var(--ease-out);
  padding-bottom: 2px;
}
.link-thread:hover, .link-thread:focus-visible { background-position: 0 100%; background-size: 100% 1px; }

/* ---------- Button ---------- */
.btn {
  --btn-fg: var(--fg);
  --btn-fill: var(--accent);
  --btn-fill-fg: var(--accent-fg);
  position: relative;
  display: inline-flex; align-items: center; gap: var(--sp-3);
  min-height: 48px; padding: 0 var(--sp-6);
  border: 1px solid currentColor; border-radius: var(--radius-pill);
  color: var(--btn-fg); background: transparent;
  font-size: var(--fs-small); font-weight: 500; letter-spacing: .04em;
  text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  touch-action: manipulation;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--btn-fill);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn:hover, .btn:focus-visible { color: var(--btn-fill-fg); border-color: var(--btn-fill); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:active { transform: scale(.98); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); --btn-fill: var(--fg); --btn-fill-fg: var(--bg); }
.btn svg { width: 1em; height: 1em; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }

/* ---------- Logo ---------- */
.logo { width: auto; height: 100%; overflow: visible; }

/* ---------- Media reveal ---------- */
.media { position: relative; overflow: hidden; background: var(--bg-sunken); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }

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