/* ==========================================================================
   Mescier Grup - base.css
   Tasarim degiskenleri, reset, tipografi, yardimci siniflar
   ========================================================================== */

:root {
  /* Renkler - lacivert / grafit / altin */
  --ink-900: #060D16;
  --ink-800: #0A1A2F;
  --ink-700: #12263F;
  --ink-600: #1C3552;
  --ink-400: #4A6482;
  --ink-500: #3C5570;
  --ink-300: #8B9CB0;
  --ink-200: #C3CDD8;

  --paper: #FFFFFF;
  --paper-soft: #F5F6F8;
  --paper-tint: #EDF0F4;
  --line: #E2E7ED;
  --line-dark: rgba(255, 255, 255, 0.14);

  --gold: #C2A05C;
  --gold-light: #D9BE86;
  --gold-dark: #9A7C3F;

  /* Tipografi - Apple sistem fontlari */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Olcekler */
  --container: 1240px;
  --container-narrow: 880px;
  --nav-h: 78px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Konteynerlar koseli; yuvarlaklik yalnizca butonlarda (999px) kullanilir */
  --radius-sm: 0;
  --radius: 2px;
  --radius-lg: 3px;

  --shadow-sm: 0 1px 2px rgba(6, 13, 22, 0.06), 0 1px 3px rgba(6, 13, 22, 0.05);
  --shadow-md: 0 8px 24px rgba(6, 13, 22, 0.08);
  --shadow-lg: 0 24px 60px rgba(6, 13, 22, 0.14);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.35s;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

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

img,
video {
  height: auto;
}

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

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

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

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

figure {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-7) 0;
}

::selection {
  background: var(--ink-800);
  color: var(--paper);
}

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

/* --------------------------------------------------------------------------
   Tipografi
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.028em;
  color: var(--ink-900);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-500);
  letter-spacing: -0.015em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.text-muted {
  color: var(--ink-500);
}

/* --------------------------------------------------------------------------
   Yerlesim yardimcilari
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Marka kartlari icin genis konteyner: kartlar buyur, basliklar tek satira sigar */
.container--genis {
  max-width: 1600px;
}

.section {
  padding-block: clamp(64px, 9vw, 128px);
}

.section--tight {
  padding-block: clamp(48px, 6vw, 80px);
}

.section--soft {
  background: var(--paper-soft);
}

.section--dark {
  background: var(--ink-900);
  color: var(--ink-200);
}

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

.section--dark .lead {
  color: var(--ink-300);
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__head--center .eyebrow {
  justify-content: center;
}

/* hidden ozniteligi her zaman kazanir: .grid gibi display veren siniflar
   aksi halde ogeyi gizlemiyordu (marka detayi acilinca kartlar duruyordu). */
[hidden] {
  display: none !important;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.stack > * + * {
  margin-top: var(--space-5);
}

.divider {
  height: 1px;
  background: var(--line);
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--ink-900);
  color: var(--paper);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Scroll ile beliren ogeler
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Duyarli kirilimlar
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .split,
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Modern hareket katmani
   Scroll ile surulen animasyonlar (animation-timeline) ve sayfa gecisleri.
   Hepsi @supports icinde: destegi olmayan tarayicida site aynen eskisi gibi
   calisir, hicbir sey bozulmaz. prefers-reduced-motion tumunu kapatir.
   ========================================================================== */

/* Ozel ozellik tanimi: degrade acisi ve isik konumu animasyon edilebilsin */
@property --isik-x {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 50%;
}

@property --isik-y {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@media (prefers-reduced-motion: no-preference) {
  /* ----------------------------------------------------------------------
     1) Sayfalar arasi gecis (View Transitions).
     Destekleyen tarayicida index <-> iletisim gecisi sicramaz, yumusar.
     ---------------------------------------------------------------------- */
  @view-transition {
    navigation: auto;
  }

  /* Header ve logo sayfa degisince yerinde kalir, yeniden cizilmez */
  .site-header {
    view-transition-name: header;
  }

  ::view-transition-old(root) {
    animation: vtCik 0.28s var(--ease) both;
  }

  ::view-transition-new(root) {
    animation: vtGir 0.4s var(--ease-out) both;
  }

  @keyframes vtCik {
    to { opacity: 0; }
  }

  @keyframes vtGir {
    from { opacity: 0; transform: translateY(8px); }
  }

  /* ----------------------------------------------------------------------
     2) Scroll ile surulen belirme.
     IntersectionObserver tek sefer tetikler; bu ise ogenin gorus alanindaki
     ilerlemesine bagli oldugu icin kaydirmayi birebir takip eder.
     ---------------------------------------------------------------------- */
  @supports (animation-timeline: view()) {
    [data-reveal] {
      /* JS sinifi beklenmez; zaman cizelgesi isi devralir */
      opacity: 1;
      transform: none;
      transition: none;
      animation: revealSurusu linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 26%;
    }

    @keyframes revealSurusu {
      from { opacity: 0; transform: translateY(26px); }
      to   { opacity: 1; transform: none; }
    }

    /* Ust ust binen ogelerde gecikme yerine hafif kaydirma kullanilir:
       zaman cizelgesinde "delay" yoktur, araligi oteleriz. */
    [data-reveal][data-reveal-delay="70"]  { animation-range: entry 6%  cover 28%; }
    [data-reveal][data-reveal-delay="140"] { animation-range: entry 4%  cover 30%; }
    [data-reveal][data-reveal-delay="210"] { animation-range: entry 2%  cover 32%; }
    [data-reveal][data-reveal-delay="280"] { animation-range: entry 0%  cover 34%; }
    [data-reveal][data-reveal-delay="350"] { animation-range: entry 0%  cover 36%; }
  }

  /* ----------------------------------------------------------------------
     3) Hero cikisi: sayfa kaydikca acilis sahnesi yavasca geri cekilir.
     ---------------------------------------------------------------------- */
  @supports (animation-timeline: view()) {
    .hero__media,
    .hero__video {
      animation: heroCikis linear both;
      animation-timeline: view();
      animation-range: exit-crossing 0% exit 100%;
    }

    @keyframes heroCikis {
      to {
        opacity: 0.25;
        transform: scale(1.08);
        filter: blur(6px);
      }
    }

    .hero .container {
      animation: heroYaziCikis linear both;
      animation-timeline: view();
      animation-range: exit-crossing 0% exit 60%;
    }

    @keyframes heroYaziCikis {
      to { opacity: 0; transform: translateY(-40px); }
    }
  }

  /* ----------------------------------------------------------------------
     4) Sayfa ilerleme cizgisi: header'in altinda ince altin serit.
     ---------------------------------------------------------------------- */
  @supports (animation-timeline: scroll()) {
    .scroll-ilerleme {
      transform-origin: 0 50%;
      animation: ilerleme linear both;
      animation-timeline: scroll(root block);
    }

    @keyframes ilerleme {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
  }
}

/* Okuma ilerleme cizgisi: header'in alt kenarina oturur.
   animation-timeline destegi yoksa scaleX(0) kalir, yani gorunmez. */
.scroll-ilerleme {
  position: fixed;
  top: calc(var(--nav-h) - 2px);
  left: 0;
  z-index: 101;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), #FFFFFF);
  pointer-events: none;
}

/* ==========================================================================
   Tipografi ve render rotusu
   ========================================================================== */

/* Basliklarda tek basina kalan kelime (dul satir) olusmaz: tarayici satirlari
   esit uzunlukta dagitir. Desteklemeyen tarayici normal sarar. */
h1,
h2,
h3 {
  text-wrap: balance;
}

.lead,
.brand-card__text,
.feature p,
.buyume-kart p {
  text-wrap: pretty;
}

/* Sayac animasyonunda rakamlar esit genislikte olur, yazi titremez */
[data-count],
.stat__deger,
.stat__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Footer gorunur alana yaklasana kadar cizilmez; ilk boyama hizlanir.
   Yalnizca footer'a uygulanir: capa hedefi olan (#markalar gibi) ya da
   scroll ile surulen animasyon tasiyan bolumlerde content-visibility
   hedefe atlamayi ve zaman cizelgesini bozabiliyor. */
@supports (content-visibility: auto) {
  .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
  }
}
