/* ==========================================================================
   RIOFEST ORGANİZASYON — Tasarım Sistemi
   tokens.css : reset, renk/tipografi değişkenleri, temel yardımcı sınıflar
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Giriş animasyonlarındaki yatay kaydırma (translateX) belgeyi geçici olarak
   genişletiyor; bu da mobilde yatay kaydırma çubuğuna ve position:fixed üst
   menünün taşmasına yol açıyordu. clip tercih edilir — hidden'ın aksine yeni
   bir kaydırma bağlamı oluşturmaz. */
html, body { overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
}

input, button, textarea, select { font: inherit; color: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[class], ol[class] { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }

button { background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--c-yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Atlama bağlantısı hedefleri programatik olarak odaklanır; bölümün etrafına
   kontur çizilmesin — gerçek klavye öğelerinin odak halkası korunur. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

/* --- Değişkenler ---------------------------------------------------------- */
:root {
  /* Marka renkleri — RIOFEST logosundan örneklendi */
  --c-pink:      #FB246B;
  --c-pink-700:  #DB0B52;
  --c-yellow:    #FFC403;
  --c-yellow-700:#7A5600;  /* krem zeminde AA: 6.3:1 (parlak sari 1.9:1 kaliyordu) */
  --c-blue:      #078CCB;
  --c-blue-700:  #0470A6;
  --c-green:     #65AA00;
  --c-purple:    #7B3FA0;
  --c-orange:    #FF7A29;
  --c-navy:      #071A46;
  --c-navy-700:  #0E2A6B;
  --c-navy-500:  #1B3E8F;

  /* Yüzeyler */
  --s-ink:       #101637;
  --s-body:      #FFFFFF;
  --s-cream:     #FFF8EE;
  --s-sand:      #FDF0E2;
  --s-line:      #E7E3F0;

  /* Metin */
  --t-strong:    #101637;
  --t-body:      #4A5170;
  --t-muted:     #767D9C;
  --t-invert:    #FFFFFF;
  --t-invert-dim:#B9C4E6;

  /* Tipografi */
  --f-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Akıcı ölçek — 360px → 1440px arası */
  --fs-xs:   0.8125rem;
  --fs-sm:   0.9375rem;
  --fs-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --fs-lg:   clamp(1.0625rem, 0.99rem + 0.34vw, 1.25rem);
  --fs-xl:   clamp(1.25rem, 1.12rem + 0.55vw, 1.5rem);
  --fs-h4:   clamp(1.35rem, 1.19rem + 0.7vw, 1.75rem);
  --fs-h3:   clamp(1.6rem, 1.3rem + 1.3vw, 2.35rem);
  --fs-h2:   clamp(2rem, 1.45rem + 2.4vw, 3.5rem);
  --fs-h1:   clamp(2.6rem, 1.5rem + 4.9vw, 5.5rem);
  --fs-mega: clamp(3.2rem, 1.4rem + 8vw, 8rem);

  /* Aralık */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --section-y: clamp(4.5rem, 3rem + 6vw, 8.5rem);

  /* Geometri */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(16, 22, 55, 0.06);
  --shadow-md: 0 14px 34px -14px rgba(16, 22, 55, 0.22);
  --shadow-lg: 0 34px 70px -28px rgba(16, 22, 55, 0.38);
  --shadow-pop: 0 20px 44px -18px rgba(251, 36, 107, 0.5);

  --wrap: 1240px;
  --gutter: clamp(1.15rem, 0.6rem + 2.4vw, 3rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.5, 1);

  --header-h: 78px;
}

/* --- Temel ---------------------------------------------------------------- */
body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.68;
  color: var(--t-body);
  background: var(--s-body);
}

h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  color: var(--t-strong);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

strong, b { font-weight: 700; color: var(--t-strong); }

::selection { background: var(--c-yellow); color: var(--c-navy); }

/* --- Düzen yardımcıları --------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }

.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }

.section--cream { background: var(--s-cream); }

.section--ink {
  background: var(--s-ink);
  color: var(--t-invert-dim);
}
.section--ink h2,
.section--ink h3,
.section--ink h4 { color: #fff; }

.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;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--c-navy);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 700;
  transition: top 0.25s var(--ease-out);
}
.skip-link:focus { top: 0; }

/* --- Bölüm başlığı -------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-pink);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
}
.eyebrow--blue { color: var(--c-blue); }
.eyebrow--yellow { color: var(--c-yellow-700); }
.section--ink .eyebrow { color: var(--c-yellow); }

.section-head { max-width: 62ch; }
.section-head p { font-size: var(--fs-lg); margin-top: var(--sp-4); }
.section-head h2 { margin-top: var(--sp-4); }

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
}

/* --- Vurgular ------------------------------------------------------------- */
.rainbow-text {
  background: linear-gradient(96deg,
    var(--c-pink) 0%,
    var(--c-orange) 22%,
    var(--c-yellow) 42%,
    var(--c-green) 62%,
    var(--c-blue) 82%,
    var(--c-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 220% 100%;
  animation: rainbow-shift 9s linear infinite;
}
@keyframes rainbow-shift {
  to { background-position: 220% 0; }
}

/* Elle çizilmiş altı çizgi efekti */
.underline-doodle {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.underline-doodle svg {
  position: absolute;
  left: -2%;
  bottom: -0.32em;
  width: 104%;
  height: 0.42em;
  overflow: visible;
  pointer-events: none;
}
.underline-doodle svg path {
  fill: none;
  stroke: var(--c-yellow);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease-out) 0.25s;
}
/* Çizim animasyonu yalnızca JS varken — aksi halde çizgi baştan görünür */
.js .underline-doodle svg path {
  stroke-dasharray: var(--dash, 1000);
  stroke-dashoffset: var(--dash, 1000);
}
.js .underline-doodle.is-drawn svg path { stroke-dashoffset: 0; }

/* --- Düğmeler ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--c-pink);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.85rem;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-body);
  font-weight: 800;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-out);
  box-shadow: var(--shadow-pop);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.42) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.75s var(--ease-out);
}
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--t-strong);
  box-shadow: inset 0 0 0 2px var(--s-line);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--c-navy); }

.btn--light {
  --btn-bg: #fff;
  --btn-fg: var(--c-navy);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}

.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.btn--outline-light:hover { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); }

.btn--yellow { --btn-bg: var(--c-yellow); --btn-fg: var(--c-navy); box-shadow: 0 20px 44px -18px rgba(255, 196, 3, 0.65); }
.btn--blue   { --btn-bg: var(--c-blue); box-shadow: 0 20px 44px -18px rgba(7, 140, 203, 0.6); }
.btn--lg     { padding: 1.18rem 2.3rem; font-size: var(--fs-base); }
.btn--sm     { padding: 0.7rem 1.3rem; font-size: var(--fs-xs); }

/* Metin bağlantısı — ok animasyonlu */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--c-pink);
}
.link-arrow svg { width: 17px; height: 17px; transition: transform 0.35s var(--ease-spring); }
.link-arrow:hover svg { transform: translateX(5px); }

/* --- Hareket tercihi ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
