/* ==========================================================================
   TUZLUK — ACIPASTA'nın renk/animasyon diliyle, tek ürün sayfası
   ========================================================================== */

:root {
  --ink:        #0E0B10;
  --ink-2:      #14101A;
  --surface:    #1B1622;
  --surface-2:  #241D2D;
  --line:       #332A3C;
  --text:       #F5EDE6;
  --muted:      #A99CA8;
  --ember:      #FF5A2D;
  --ember-soft: #FF8A5B;
  --sugar:      #FFB4CE;
  --zest:       #9BE870;
  --amber:      #FFC24B;
  --danger:     #FF5D6E;
  --on-ember:   #1A0A04;
  --shadow-1:   0 1px 0 rgba(255,255,255,.04), 0 10px 30px -18px rgba(0,0,0,.9);
  --shadow-2:   0 24px 60px -30px rgba(0,0,0,.95);
  --glow:       radial-gradient(60% 60% at 50% 0%, rgba(255,90,45,.28), transparent 70%);
  --r-sm: 6px; --r-md: 12px; --r-lg: 22px; --r-pill: 999px;
  --tap: 44px;
  --wrap: 1080px;
  --gutter: clamp(18px, 4vw, 40px);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --t-fast: .16s; --t-mid: .32s; --t-slow: .6s;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink:        #FBF5EF;
  --ink-2:      #F4ECE3;
  --surface:    #FFFFFF;
  --surface-2:  #F6EEE7;
  --line:       #E2D5C8;
  --text:       #21161C;
  --muted:      #6B5C64;
  --ember:      #D6350B;
  --ember-soft: #B62D08;
  --sugar:      #B4416E;
  --zest:       #3F7A22;
  --amber:      #8A5A00;
  --danger:     #C21F32;
  --on-ember:   #FFF6F2;
  --shadow-1:   0 1px 0 rgba(255,255,255,.7), 0 12px 28px -22px rgba(60,30,20,.55);
  --shadow-2:   0 26px 60px -34px rgba(60,30,20,.45);
  --glow:       radial-gradient(60% 60% at 50% 0%, rgba(214,53,11,.12), transparent 70%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--ink); color: var(--text);
  font-family: var(--font-body); font-size: clamp(15.5px, .35vw + 15px, 17px); line-height: 1.65;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  transition: background-color var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}
body.is-locked { overflow: hidden; }
img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; letter-spacing: -.022em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
a { color: var(--ember); text-decoration-color: color-mix(in oklab, var(--ember) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--sugar); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.page { padding-block: clamp(80px, 12vh, 120px) clamp(60px, 10vh, 100px); position: relative; z-index: 1; animation: pageIn .45s var(--ease-out) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }

.skip { position: fixed; top: 8px; left: 8px; z-index: 200; transform: translateY(-160%); background: var(--ember); color: var(--on-ember); padding: 12px 18px; border-radius: var(--r-pill); font-weight: 600; transition: transform var(--t-fast) var(--ease); }
.skip:focus { transform: translateY(0); }

/* ---------------------------------------------------------------- arka plan */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .75; }
.bg-glow { position: fixed; inset: -20% -10% auto; height: 70vh; z-index: 0; pointer-events: none; background: var(--glow); animation: drift 22s var(--ease) infinite alternate; }
@keyframes drift { from { transform: translate3d(-4%,0,0) scale(1); } to { transform: translate3d(6%,4%,0) scale(1.12); } }

.cursor, .cursor-ring { display: none; }
@media (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none; }
  html.has-cursor .cursor { display: grid; place-items: center; position: fixed; top:0; left:0; z-index: 300; pointer-events: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ember); }
  html.has-cursor .cursor-ring { display: block; position: fixed; top:0; left:0; z-index: 299; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid color-mix(in oklab, var(--ember) 65%, transparent); border-radius: 50%; transition: width var(--t-fast) var(--ease), height var(--t-fast) var(--ease), margin var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
  html.has-cursor .cursor-ring.is-hot { width: 62px; height: 62px; margin: -31px 0 0 -31px; background: color-mix(in oklab, var(--ember) 14%, transparent); border-color: var(--ember); }
  html.has-cursor .cursor-ring.is-text { width: 3px; height: 30px; margin: -15px 0 0 -1px; border-radius: 2px; background: var(--sugar); border-color: transparent; }
}

/* ------------------------------------------------------------------ başlık */
.site-head { position: fixed; top:0; left:0; right:0; z-index: 90; padding-top: env(safe-area-inset-top); background: color-mix(in oklab, var(--ink) 82%, transparent); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--t-mid), transform var(--t-mid) var(--ease); }
.site-head.is-stuck { border-bottom-color: var(--line); }
.site-head__in { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
.brand__mark { width: 28px; height: 28px; }
.brand__from { font: 500 .72rem/1 var(--font-mono); color: var(--muted); margin-left: 4px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav__link { position: relative; color: var(--text); text-decoration: none; padding: 10px 12px; min-height: var(--tap); display: inline-flex; align-items: center; border-radius: var(--r-sm); font-weight: 500; font-size: .95rem; }
.nav__link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px; background: var(--ember); transform: scaleX(0); transform-origin: left; transition: transform var(--t-mid) var(--ease-out); }
.nav__link:hover::after { transform: scaleX(1); }
.head-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); text-decoration: none; font: 600 .8rem/1 var(--font-mono); transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast) var(--ease); }
.icon-btn:hover { border-color: var(--ember); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ico--moon { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .ico--sun { display: none; }
:root[data-theme="light"] .ico--moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .menu-btn__bars { display: grid; gap: 5px; width: 18px; }
  .menu-btn__bars i { height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--t-mid) var(--ease); }
  .menu-btn[aria-expanded="true"] .menu-btn__bars i:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-btn__bars i:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav { position: fixed; inset: 0; z-index: 80; flex-direction: column; justify-content: center; gap: 4px; background: color-mix(in oklab, var(--ink) 96%, transparent); padding: 90px var(--gutter) 40px; transform: translateY(-100%); visibility: hidden; transition: transform var(--t-slow) var(--ease-out), visibility var(--t-slow); }
  .nav.is-open { transform: translateY(0); visibility: visible; }
  .nav__link { font-size: 1.5rem; font-family: var(--font-display); font-weight: 700; padding: 12px 4px; }
}

/* ------------------------------------------------------------------ butonlar */
.btn { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: var(--tap); padding: 12px 20px; border: 1px solid var(--btn-bd); border-radius: var(--r-pill); background: var(--btn-bg); color: var(--btn-fg); font: 600 .96rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease), background-color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-busy { opacity: .62; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; fill: currentColor; }
.btn--primary { --btn-bg: var(--ember); --btn-fg: var(--on-ember); --btn-bd: var(--ember); }
.btn--ghost { --btn-bg: transparent; --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bd: var(--ember); }
.btn--sugar { --btn-bg: color-mix(in oklab, var(--sugar) 16%, var(--surface)); --btn-bd: var(--sugar); --btn-fg: var(--sugar); }
.btn--go { --btn-bg: color-mix(in oklab, var(--zest) 18%, var(--surface)); --btn-bd: var(--zest); --btn-fg: var(--zest); }
.btn--quiet { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--muted); }
.btn--quiet:hover { --btn-fg: var(--text); --btn-bd: var(--line); }
.btn--tiny { min-height: 32px; padding: 6px 12px; font-size: .78rem; }
.btn--wide { width: 100%; }
@media (pointer: coarse) { .btn--tiny { min-height: var(--tap); padding: 10px 16px; } }

/* -------------------------------------------------------------------- hero */
.hero { display: grid; gap: clamp(24px, 5vw, 50px); grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero__kicker { font: 600 .8rem/1 var(--font-mono); color: var(--ember); letter-spacing: .06em; margin-bottom: 18px; display: inline-flex; align-items: center; gap: 8px; }
.hero__salt { font-size: 1.1em; animation: shake 4s var(--ease) infinite; display: inline-block; }
@keyframes shake { 0%,92%,100% { transform: rotate(0); } 94% { transform: rotate(-14deg); } 96% { transform: rotate(11deg); } 98% { transform: rotate(-6deg); } }
.hero__title .word { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(1.2deg); animation: wordIn .7s var(--ease-out) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; } }
.hero__body { font-size: 1.08rem; color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.hero__stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }
.hero__stat span { font-size: .82rem; color: var(--muted); }

/* ----------------------------------------------------------- kod penceresi */
.window { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--ink-2); box-shadow: var(--shadow-2); overflow: hidden; }
.window__bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.window__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.window__dot:nth-child(1) { background: var(--danger); }
.window__dot:nth-child(2) { background: var(--amber); }
.window__dot:nth-child(3) { background: var(--zest); }
.window__name { margin-left: 8px; font: 500 .78rem/1 var(--font-mono); color: var(--muted); }
.window pre { margin: 0; padding: 20px; overflow-x: auto; }
.window code { font: 400 13.5px/1.75 var(--font-mono); color: var(--text); white-space: pre; }
.tok-kw { color: var(--sugar); } .tok-fn { color: var(--amber); } .tok-str { color: var(--zest); } .tok-var { color: var(--ember-soft); } .tok-com { color: var(--muted); font-style: italic; }

/* -------------------------------------------------------------------- kart */
.section { margin-top: clamp(60px, 10vh, 116px); }
.section__head { margin-bottom: 26px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: border-color var(--t-mid), transform var(--t-mid) var(--ease), box-shadow var(--t-mid); }
.card:hover { transform: translateY(-3px); border-color: var(--ember); box-shadow: var(--shadow-1); }
.card__icon { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: color-mix(in oklab, var(--ember) 14%, transparent); color: var(--ember); margin-bottom: 4px; }
.card__icon .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__title { font-size: 1.08rem; margin: 0; }
.card__text { color: var(--muted); font-size: .93rem; margin: 0; }

/* ------------------------------------------------------------------- kod bloğu (genel) */
.code { margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--ink-2); }
.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.code__lang { font: 600 .74rem/1 var(--font-mono); color: var(--muted); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; }
.code code { font: 400 13.5px/1.7 var(--font-mono); color: var(--text); white-space: pre; }

/* ------------------------------------------------------------------- form */
.form { display: grid; gap: 18px; max-width: 560px; }
.field { display: grid; gap: 7px; position: relative; }
.field__label { font-weight: 600; font-size: .92rem; }
.field__help { color: var(--muted); font-size: .82rem; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"] {
  width: 100%; min-height: var(--tap); padding: 12px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md); font: inherit; font-size: 16px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform .12s var(--ease);
}
input:focus { border-color: var(--ember); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ember) 18%, transparent); outline: none; }
.field.is-bad input { border-color: var(--danger); animation: shakeField .32s var(--ease); }
.field.is-good input { border-color: var(--zest); }
@keyframes shakeField { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.field__error {
  color: var(--danger); font-size: .84rem; font-weight: 500; margin: 0;
  max-height: 0; overflow: hidden; opacity: 0; transition: max-height var(--t-mid) var(--ease), opacity var(--t-fast);
}
.field.is-bad .field__error { max-height: 60px; opacity: 1; }
.field__check { position: absolute; right: 14px; top: 38px; width: 20px; height: 20px; color: var(--zest); opacity: 0; transform: scale(.6); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); }
.field.is-good .field__check { opacity: 1; transform: scale(1); }
.form__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spinner { width: 18px; height: 18px; border: 2px solid color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--r-md); padding: 16px 18px; margin-top: 4px; display: none; }
.result.is-visible { display: block; animation: resultIn .4s var(--ease-out); }
.result--ok { border-left-color: var(--zest); background: color-mix(in oklab, var(--zest) 8%, var(--surface)); }
.result--error { border-left-color: var(--danger); background: color-mix(in oklab, var(--danger) 8%, var(--surface)); }
@keyframes resultIn { from { opacity: 0; transform: translateY(-8px); } }
.result h3 { margin: 0 0 6px; font-size: 1rem; }
.result p { margin: 0; }

/* ------------------------------------------------------------------ tablo */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font: 600 .78rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.table td code { font: 500 .84em var(--font-mono); background: var(--surface-2); padding: 2px 6px; border-radius: var(--r-sm); }
.table tr:hover td { background: var(--surface-2); }

/* ------------------------------------------------------------------ toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); z-index: 150; bottom: calc(env(safe-area-inset-bottom) + 18px); display: grid; gap: 8px; width: min(94vw, 460px); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ember); border-radius: var(--r-md); padding: 13px 16px; box-shadow: var(--shadow-2); animation: toastIn .4s var(--ease-out); }
.toast--ok { border-left-color: var(--zest); }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ----------------------------------------------------------------- footer */
.site-foot { position: relative; z-index: 1; margin-top: clamp(70px, 12vh, 120px); border-top: 1px solid var(--line); background: var(--ink-2); padding: 36px 0 calc(env(safe-area-inset-bottom) + 30px); }
.site-foot__in { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.site-foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot__links a { color: var(--muted); text-decoration: none; }
.site-foot__links a:hover { color: var(--ember); }

/* --------------------------------------------------------- azaltılmış hareket */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__title .word { opacity: 1; transform: none; }
  .page { animation: none; }
  #bg { display: none; }
}
