/* ==========================================================================
   STMACH Robotics - main.css
   TOKEN'lar + reset + tipografi + global yardimcilar.
   KURAL: renk/olcu hardcode YOK, her zaman token. Yon icin logical property.
   ========================================================================== */

/* ---------------------------------------------------------------- TOKENS */
:root {
  /* Marka renkleri - logo vektorunden, kesin */
  --st-orange:      #F5821F;
  --st-orange-2:    #E18721;
  --st-slate:       #475E69;
  --st-slate-dark:  #2E3F48;
  --st-paper:       #F1F1F1;
  --st-white:       #FFFFFF;

  /* Turuncu rol tokenlari - MUSTERI KARARI: hepsi marka turuncusuna geri
     alindi, sayfada tek bir turuncu bulunsun diye (26.08.2026).

     Bilinen bedeli: marka turuncusu uzerindeki beyaz yazi 2.59:1, turuncu
     yazi beyaz zeminde 2.59:1 - ikisi de WCAG AA'nin (4.5:1) altinda.
     Tekrar AA'ya donmek istenirse SADECE bu dort satir degistirilir,
     kullanim yerlerine dokunmaya gerek yok:
       --st-orange-text: #AD5309   (acik zeminde yazi, 5.23:1)
       --st-orange-ink:  #FF9F45   (koyu zeminde yazi, 5.36:1)
       --st-orange-cta:  #B25E16   (beyaz yazili dolgu, 4.66:1)
       --st-orange-cta-hover: #9F5514 */
  --st-orange-text:      var(--st-orange);
  --st-orange-ink:       var(--st-orange);
  --st-orange-cta:       var(--st-orange);
  --st-orange-cta-hover: var(--st-orange-2);

  /* Turev tonlar (token'dan uretilir, yeni hex yazma) */
  --st-orange-soft: color-mix(in srgb, var(--st-orange) 12%, transparent);
  /* Ikincil metin. %62 saydamlik beyaz uzerinde 2.86:1 veriyordu (AA altinda);
     %90 ile beyazda 5.35:1, paper zeminde 4.74:1 - ton neredeyse ayni. */
  --st-slate-60:    color-mix(in srgb, var(--st-slate) 90%, transparent);
  --st-line:        color-mix(in srgb, var(--st-slate) 14%, transparent);
  --st-line-ink:    color-mix(in srgb, var(--st-white) 16%, transparent);

  /* Rol renkleri */
  --bg-page:        var(--st-paper);
  --bg-card:        var(--st-white);
  --bg-ink:         var(--st-slate-dark);
  --text:           var(--st-slate);
  --text-strong:    var(--st-slate-dark);
  --text-muted:     var(--st-slate-60);
  --text-on-ink:    var(--st-white);
  --text-muted-ink: color-mix(in srgb, var(--st-white) 70%, transparent);

  /* Kose */
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:  16px;
  --radius-xl:  24px;   /* hero cercevesi */
  --radius-pill: 999px;

  /* Golge */
  --shadow:    0 1px 2px color-mix(in srgb, var(--st-slate-dark) 10%, transparent);
  --shadow-md: 0 4px 16px color-mix(in srgb, var(--st-slate-dark) 12%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, var(--st-slate-dark) 18%, transparent);

  /* Bosluk olcegi */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 24px;  --space-6: 32px;  --space-7: 40px;  --space-8: 56px;
  --space-9: 72px;  --space-10: 96px;

  --section-y: clamp(48px, 6vw, 96px);
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 32px);

  /* Tam genislikte kaydirilan seritlerin (kategori kartlari, urun sekmeleri)
     ic dolgusu. Serit sayfa kapsayicisinin disindadir ama ilk ogesi
     kapsayiciyla ayni hizada baslar; hizayi bu deger saglar. */
  --rail-pad: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));

  /* Baslik yuksekligi. Baslik sayfa akisindan cikarildigi (fixed) icin
     <main> bu kadar ust bosluk alir, hero da bu kadar yukari cekilir -
     iki deger tek yerden gelmezse slider basligin altina tam oturmaz. */
  --header-h: 76px;

  /* Tipografi */
  --ff-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
             'Helvetica Neue', Arial, sans-serif;
  --ff-ar:   'IBM Plex Sans Arabic', 'Noto Naskh Arabic', var(--ff-body);

  --fs-h1: clamp(28px, 4.2vw, 52px);
  --fs-h2: clamp(24px, 3.2vw, 38px);
  --fs-h3: clamp(19px, 2vw, 24px);
  --fs-h4: clamp(17px, 1.5vw, 20px);
  --fs-body: clamp(15px, 1.05vw, 17px);
  --fs-sm: 14px;
  --fs-xs: 12px;
  --fs-num: clamp(32px, 4.5vw, 56px);   /* sayac / teknik vurgu */

  --lh-tight: 1.15;
  --lh: 1.6;

  /* Hareket */
  --dur: 260ms;
  --dur-slow: 520ms;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --z-header: 100;
  --z-drawer: 200;
}

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

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

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-3);
  color: var(--text-strong);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-block-end: 0; }

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

/* Metin ICINDEKI baglantilar alti cizili olur: sadece renkle ayrilan link
   renk korlugu olan kullanicida gorunmez olur, koyu zeminde ise hic
   ayirt edilmiyor. Menu/kart/buton baglantilari bu kuralin disinda. */
.page-head__lead a,
.section__lead a,
.cat-block__lead a,
.prose a,
.contact-aside__note a,
.product__lead a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

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

/* [hidden] BU SATIRDAN SONRA VE !important ILE: yukaridaki display:block bir
   yazar kuralidir ve tarayicinin kendi [hidden]{display:none} kuralini ezer;
   ayrica display veren her bilesen sinifi (ornegin .gallery__expand) bu
   dosyadan sonra yuklendigi icin ozgullugu esit gecip yine one gecerdi.
   Sonuc olculdu: hidden verilmis <video> ekranda durmaya ve tiklamayi
   yakalamaya devam ediyordu. Tema bugune kadar bunu bilesen basina
   ".mega[hidden] { display: none }" gibi satirlarla cozuyordu - onlar
   duruyor, yenilerine gerek kalmiyor. */
[hidden] { display: none !important; }

/* YUKLEME ZEMINI IMG'DE DEGIL KAPSAYICIDA.
   Burada "img { background-color: var(--st-line) }" vardi; amaci gorsel
   inene kadar notr bir zemin gostermekti ama SEFFAF gorsellerde kalici
   duruyordu - logo (SVG) beyaz basligin uzerinde gri bir kutu icinde
   gorunuyordu. Zemin zaten .media kapsayicisinda tanimli (ve urun/katalog
   kutulari ustune kendi rengini koyuyor); img'de ikinci kez vermek hem
   gereksiz hem de seffafligi bozuyordu. */

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

/* dl/dd de sifirlanir: tarayici <dd>'ye 40px girinti veriyor ve teknik
   deger, etiketinden kayiyor (spec satirlari, sayfa basi sayilari,
   urun ozeti hep <dl> kullaniyor). */
dl, dd { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--st-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------- SKIP LINK */
.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--space-4);
  z-index: 999;
  padding: var(--space-3) var(--space-5);
  background: var(--st-orange);
  color: var(--st-white);
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  transition: inset-block-start var(--dur) var(--ease);
}
.skip-link:focus { inset-block-start: 0; color: var(--st-white); }

/* ---------------------------------------------------------------- LAYOUT */
.container-st {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .62); }

.section--ink { background: var(--bg-ink); color: var(--text-on-ink); }
.section--ink h1, .section--ink h2,
.section--ink h3, .section--ink h4 { color: var(--text-on-ink); }
.section--ink .section__lead { color: var(--text-muted-ink); }

.section--paper { background: var(--bg-page); }
.section--white { background: var(--st-white); }

/* Bolum basligi blogu - her bolumde birebir ayni markup */
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: var(--space-7);
}
.section__head-text { max-width: 62ch; }
.section__title { margin-block-end: var(--space-2); }
.section__lead { color: var(--text-muted); margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
  color: var(--st-orange-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  inline-size: 24px;
  block-size: 2px;
  background: var(--st-orange);
  flex: none;
}


/* Koyu zeminde turuncu metin acik tonu kullanir (AA). */
.section--ink .eyebrow,
.cta .eyebrow { color: var(--st-orange-ink); }
.section--ink .link-more,
.cta .link-more { color: var(--st-orange-ink); }
/* Dugmeler haric: .cta a:hover (0,2,1) .btn-st--accent:hover (0,2,0) kuralini
   eziyor ve turuncu dugmede yazi turuncuya donup kayboluyordu. */
.section--ink a:not(.btn-st):hover,
.cta a:not(.btn-st):hover,
.footer a:not(.btn-st):hover { color: var(--st-orange-ink); }

/* Kart izgarasi - tum listeleme bolumlerinde tek desen */
.grid-st {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.grid-st--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-st--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Sabit oranli gorsel kutusu - CLS'i sifirlar */
.media {
  position: relative;
  overflow: hidden;
  background: var(--st-line);
  border-radius: var(--radius);
}
.media > img,
.media > video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--3x2  { aspect-ratio: 3 / 2; }
.media--1x1  { aspect-ratio: 1 / 1; }

/* --------------------------------------------------------------- BUTTONS */
.btn-st {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--st-slate-dark);
  color: var(--st-white);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn-st:hover { background: var(--st-slate); color: var(--st-white); transform: translateY(-1px); }
.btn-st:active { transform: translateY(0); }

.btn-st--accent { background: var(--st-orange-cta); }
.btn-st--accent:hover { background: var(--st-orange-cta-hover); color: var(--st-white); }

.btn-st--ghost {
  background: transparent;
  border-color: var(--st-line);
  color: var(--text-strong);
}

/* WhatsApp: marka yesili, urun detayindaki hizli iletisim dugmesi. Diger
   dugmelerle ayni yukseklik/olcu, yalnizca renk farkli. */
.btn-st--whatsapp {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}
.btn-st--whatsapp:hover { background: #1DA851; border-color: #1DA851; color: #fff; }
.btn-st--whatsapp .icon { inline-size: 18px; block-size: 18px; }
.btn-st--ghost:hover {
  background: var(--st-white);
  border-color: var(--st-orange);
  color: var(--st-orange-text);
}

.btn-st--ghost-ink {
  background: transparent;
  border-color: var(--st-line-ink);
  color: var(--st-white);
}
.btn-st--ghost-ink:hover {
  background: var(--st-white);
  border-color: var(--st-white);
  color: var(--st-slate-dark);
}

.btn-st--sm { padding: var(--space-2) var(--space-4); font-size: var(--fs-xs); }
.btn-st--block { display: flex; inline-size: 100%; }

/* Metin baglantisi + ok - "Incele" deseni */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--st-orange-text);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.link-more .icon { transition: transform var(--dur) var(--ease); }
.link-more:hover .icon { transform: translateX(4px); }

/* ----------------------------------------------------------------- ICONS */
.icon {
  inline-size: 1em;
  block-size: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--lg { inline-size: 1.5em; block-size: 1.5em; }
/* Yon belirten ikonlar RTL'de ayna cevrilir - bkz. rtl.css */

/* ----------------------------------------------- SCROLL REVEAL / SAYACLAR */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
/* JS yoksa icerik yine gorunur */
.no-js [data-reveal] { opacity: 1; transform: none; }

[data-countup] {
  font-size: var(--fs-num);
  font-weight: 700;
  line-height: 1;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* --------------------------------------------------- REDUCED MOTION / DATA */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* Bos durum notu - listesi henuz doldurulmamis sayfalar (ör. projeler).
   Panele baglaninca icerik gelince bu blok gorunmez olur. */
.empty-note {
  max-width: 62ch;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
  background: var(--bg-card);
  border: 1px dashed var(--st-line);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
}
