/* =========================================================================
   SORKUNLU TEKSTİL — Design System: Foundations
   Ref: Website Anayasası V2 §23 (Görsel tasarım anayasası), §22.4 (Erişilebilirlik)

   Katmanlar:
     base.css        → token, reset, tipografi, layout primitives   (bu dosya)
     components.css  → header, footer, buton, kart, form, section
     pages.css       → sayfaya özel kompozisyonlar
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. TOKENS
   ---------------------------------------------------------------------- */
:root {
  /* --- Renk: §23.2 --------------------------------------------------- */
  --c-ivory:        #f7f4ef;   /* primary background — warm white */
  --c-ivory-deep:   #efeae1;   /* alternate band background */
  --c-ivory-soft:   #fbf9f6;   /* raised surface */

  --c-ink:          #14171c;   /* primary text — deep ink */
  --c-ink-80:       #14171cd9;
  --c-ink-60:       #14171c99;
  --c-ink-40:       #14171c66;

  --c-navy:         #0e1a2b;   /* dark editorial band */
  --c-navy-deep:    #0a121e;

  --c-stone:        #8c8578;   /* secondary — warm grey */
  --c-stone-light:  #c9c2b6;
  --c-stone-pale:   #e3ded5;

  /* Sorkunlu corporate blue.
     ⚠ PLACEHOLDER — kesin HEX kurumsal kimlik dosyasından doğrulanacak (§23.2).
     Değiştirmek için yalnız bu iki satır yeterlidir. */
  /* Marka renkleri — Sorkunlu_Logo_Presentation_2.pdf'ten okundu (2023). */
  --c-brand-navy:   #2c3a4c;   /* marka laciverti */
  --c-brand-blue:   #657fa1;   /* marka mavisi — GÖRSEL renk, metin için değil */
  --c-brand-pale:   #becfdf;   /* marka açık mavisi */
  --c-brand-logo:   #385889;   /* logo mavisi — sorkunlu.com.tr/img/logos.svg ile birebir */
  --c-brand-logo-deep: #2e4871; /* logo mavisinin hover koyusu */

  /* Etkileşim rengi. Marka mavisi ivory üzerinde yalnız 3.75:1 veriyor ve
     --c-accent link/FAQ/mega hover'larında NORMAL boyutlu metin rengi olarak
     kullanılıyor; doğrudan takılsaydı bu metinler AA'nın altına düşerdi.
     Bu yüzden markanın kendi lacivert→mavi ekseninden AAA veren ton alındı:
     #3d4f66 ivory üzerinde 7.66:1. */
  --c-accent:       #3d4f66;
  --c-accent-deep:  #2f3d50;

  --c-line:         #14171c1f;
  --c-line-soft:    #14171c12;
  --c-line-invert:  #f7f4ef2e;

  --c-danger:       #8c2f22;
  --c-success:      #2f5d43;

  /* --- Tipografi: §23.3 ---------------------------------------------- */
  --f-display: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Akışkan tip ölçeği — 360px → 1600px arası kesintisiz */
  --t-hero:    clamp(3.25rem, 1.2rem + 9vw,    9rem);
  --t-display: clamp(2.5rem,  1.2rem + 5.6vw,  5.5rem);
  --t-h1:      clamp(2.25rem, 1.3rem + 4vw,    4rem);
  --t-h2:      clamp(1.75rem, 1.2rem + 2.4vw,  2.875rem);
  --t-h3:      clamp(1.3125rem, 1.1rem + 0.9vw, 1.75rem);
  --t-h4:      clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --t-lead:    clamp(1.0625rem, 1rem + 0.5vw,  1.375rem);
  --t-body:    1rem;
  --t-small:   0.875rem;
  --t-micro:   0.75rem;

  --lh-tight:  1.02;
  --lh-snug:   1.16;
  --lh-normal: 1.5;
  --lh-relaxed: 1.68;

  --ls-hero:   -0.03em;
  --ls-tight:  -0.015em;
  --ls-normal: -0.005em;
  --ls-eyebrow: 0.16em;

  /* --- Uzay: §23.4 fluid spacing -------------------------------------- */
  --s-3xs: 0.25rem;
  --s-2xs: 0.5rem;
  --s-xs:  0.75rem;
  --s-sm:  1rem;
  --s-md:  1.5rem;
  --s-lg:  2.25rem;
  --s-xl:  3.5rem;
  --s-2xl: clamp(3.5rem, 2rem + 6vw,  7rem);
  --s-3xl: clamp(5rem,   2rem + 10vw, 11rem);

  /* --- Layout: 12 kolon (§23.4) --------------------------------------- */
  --shell-max: 90rem;      /* 1440 */
  --shell-pad: clamp(1.25rem, 0.5rem + 3.2vw, 5rem);
  --measure:   68ch;       /* okuma genişliği */
  --measure-tight: 46ch;

  /* --- Motion: §23.7 --------------------------------------------------- */
  --e-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --e-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --d-fast: 180ms;
  --d-base: 340ms;
  --d-slow: 720ms;

  --header-h: 4.75rem;
}

@media (min-width: 60rem) {
  :root { --header-h: 5.5rem; }
}

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

* { margin: 0; }

/* `hidden` özniteliği her zaman kazanmalı.
   .btn gibi display taşıyan sınıflar UA'nın [hidden] kuralını eziyordu. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  background: var(--c-ivory);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

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

table { border-collapse: collapse; width: 100%; }

/* Görünür focus — §22.4 */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Etkileşimli olmayan, yalnız ekran okuyucu odağı için hedeflenen elemanlar
   (adım başlıkları, sonuç panelleri) görünür halka göstermez. */
[tabindex="-1"]:focus { outline: none; }

.invert :focus-visible { outline-color: var(--c-ivory); }

::selection { background: var(--c-ink); color: var(--c-ivory); }

/* -------------------------------------------------------------------------
   3. TİPOGRAFİ
   ---------------------------------------------------------------------- */
.t-hero,
.t-display,
.t-h1,
.t-h2 {
  font-family: var(--f-display);
  font-weight: 300;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-hero);
  text-wrap: balance;
}

.t-hero    { font-size: var(--t-hero); }
.t-display { font-size: var(--t-display); }
.t-h1      { font-size: var(--t-h1);  line-height: var(--lh-snug); }
.t-h2      { font-size: var(--t-h2);  line-height: var(--lh-snug); letter-spacing: var(--ls-tight); }

.t-h3 {
  font-family: var(--f-sans);
  font-size: var(--t-h3);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

.t-h4 {
  font-family: var(--f-sans);
  font-size: var(--t-h4);
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: var(--ls-normal);
}

.t-lead {
  font-size: var(--t-lead);
  line-height: 1.46;
  font-weight: 300;
  color: var(--c-ink-80);
  max-width: var(--measure);
  text-wrap: pretty;
}

.t-body {
  line-height: var(--lh-relaxed);
  color: var(--c-ink-80);
  max-width: var(--measure);
  text-wrap: pretty;
}

.t-small {
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--c-ink-60);
}

/* Eyebrow — bölüm numarası / kategori etiketi */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-stone);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  flex: none;
  opacity: 0.65;
}

.eyebrow--bare::before { display: none; }

/* Serif italik vurgu — quiet luxury aksanı */
.accent-italic {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
}

.text-stone  { color: var(--c-stone); }
.text-muted  { color: var(--c-ink-60); }

/* -------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   ---------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.shell--wide { max-width: 108rem; }

/* Full-bleed: shell içinden kenardan kenara taşmak için */
.bleed {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.section {
  padding-block: var(--s-3xl);
  position: relative;
}

.section--tight  { padding-block: var(--s-2xl); }
.section--flush-top { padding-block-start: 0; }

.band-deep  { background: var(--c-ivory-deep); }
.band-navy  { background: var(--c-navy); color: var(--c-ivory); }

.band-navy .t-lead,
.band-navy .t-body { color: #f7f4efcc; }
.band-navy .eyebrow,
.band-navy .text-stone { color: var(--c-stone-light); }

/* 12 kolon grid */
.grid12 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-md);
}

@media (min-width: 48rem) {
  .grid12 { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-lg); }
}

@media (min-width: 64rem) {
  .grid12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* Otomatik kart grid'i */
.grid-auto {
  display: grid;
  gap: var(--s-md);
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
}

.grid-2 { display: grid; gap: var(--s-lg); }
.grid-3 { display: grid; gap: var(--s-lg); }

@media (min-width: 48rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.stack > * + * { margin-block-start: var(--s-md); }
.stack-sm > * + * { margin-block-start: var(--s-2xs); }
.stack-lg > * + * { margin-block-start: var(--s-lg); }

.flow-tight { max-width: var(--measure-tight); }

.rule {
  border: 0;
  border-top: 1px solid var(--c-line);
  margin: 0;
}

.band-navy .rule { border-color: var(--c-line-invert); }

/* Section başlık bloğu — asimetrik editorial yerleşim (§23.4) */
.section-head {
  display: grid;
  gap: var(--s-md);
  margin-block-end: var(--s-xl);
}

@media (min-width: 64rem) {
  .section-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: var(--s-2xl);
    align-items: end;
  }
  .section-head__aside { padding-block-end: var(--s-3xs); }
}

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

.skip-link {
  position: absolute;
  inset-inline-start: var(--s-sm);
  inset-block-start: var(--s-sm);
  z-index: 200;
  transform: translateY(-200%);
  background: var(--c-ink);
  color: var(--c-ivory);
  padding: var(--s-xs) var(--s-md);
  font-size: var(--t-small);
  font-weight: 500;
  transition: transform var(--d-fast) var(--e-out);
}

.skip-link:focus { transform: translateY(0); }

/* -------------------------------------------------------------------------
   6. MOTION — §23.7 / reduced-motion §22.4
   ---------------------------------------------------------------------- */
/* Gizleme YALNIZ `js-reveal` sınıfı varken uygulanır. Bu sınıfı <head>'deki
   satır içi script, IntersectionObserver desteğini ve reduced-motion tercihini
   doğruladıktan sonra ekler.

   Sebep: gizlemeyi koşulsuz yaparsak, observer herhangi bir nedenle çalışmadığında
   (JS hatası, eski tarayıcı, tarama motoru) sayfa boş görünür. Varsayılan durum
   her zaman "içerik görünür" olmalıdır (§25.2). */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity var(--d-slow) var(--e-out),
    transform var(--d-slow) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-reveal [data-reveal].is-revealed {
  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;
    scroll-behavior: auto !important;
  }

  .js-reveal [data-reveal] { opacity: 1 !important; transform: none !important; }
}
