/* Instagram tarzı profil + gönderi arayüzü (koyu tema) */
:root {
  --bg: #0c1014;
  --elev: #121a20;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, .13);
  --btn: #262a30;
  --btn-hover: #32373e;
  --blue: #0095f6;
  --blue-hover: #1877f2;
  --max: 935px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.i { width: 24px; height: 24px; flex: none; }
.i-sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.verified { width: 18px; height: 18px; margin-left: 6px; flex: none; vertical-align: -3px; }

/* Buttons */
.ig-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; border-radius: 8px;
  background: var(--btn); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s;
}
.ig-btn:hover { background: var(--btn-hover); }
.ig-btn-blue { background: var(--blue); color: #fff; }
.ig-btn-blue:hover { background: var(--blue-hover); }
.ig-btn-block { width: 100%; height: 44px; font-size: 15px; }

/* Destek ol (Patreon) */
.ig-btn-icon { width: 34px; padding: 0; }
.ig-btn-support .i { color: #ff424d; }
.support-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 10px 10px 12px; border-radius: 10px;
  background: var(--btn); border: 1px solid transparent; font-size: 13px; line-height: 1.35;
  transition: background .15s, border-color .3s, box-shadow .3s;
}
.support-card:hover { background: var(--btn-hover); }
.support-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 66, 77, .14); color: #ff424d; }
.support-text { color: var(--muted); }
.support-text b { color: var(--text); font-weight: 600; }
.support-cta { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; background: var(--text); color: #0c1014; font-weight: 700; font-size: 13px; white-space: nowrap; }
.support-cta .i { width: 13px; height: 13px; }
.support-card.is-nudge { border-color: rgba(255, 66, 77, .55); box-shadow: 0 0 0 4px rgba(255, 66, 77, .12); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 975px; margin: 0 auto; padding: 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { height: 32px; width: auto; max-width: 140px; object-fit: contain; }
.brand-caption { font-weight: 800; font-size: 12px; letter-spacing: .34em; text-transform: uppercase; white-space: nowrap; }
.topbar-ig { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; }
.topbar-ig:hover { background: var(--btn); }

/* Profile header */
.profile {
  display: grid; max-width: var(--max); margin: 0 auto; padding: 30px 20px 40px;
  grid-template-columns: 290px minmax(0, 1fr);
  grid-template-areas: "photo row" "photo counts" "photo bio";
  align-items: start;
}
.profile-main { display: contents; }
.profile-photo { grid-area: photo; position: relative; justify-self: center; align-self: center; width: 150px; height: 150px; padding: 7px; border-radius: 50%; margin-right: 30px; }
.profile-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #262626; }
/* Hikâye halkası (ince, tek renk) */
@property --ring { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
.profile-photo::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; padding: 2px; pointer-events: none;
  background: conic-gradient(rgba(255, 255, 255, .7) var(--ring), rgba(255, 255, 255, .1) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.profile-row { grid-area: row; display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.username { display: inline-flex; align-items: center; margin: 0; font-size: 20px; font-weight: 600; }
.profile-actions { display: flex; gap: 8px; }
.counts { grid-area: counts; display: flex; gap: 40px; list-style: none; margin: 20px 0; padding: 0; font-size: 16px; }
.counts b { font-weight: 600; }
.bio { grid-area: bio; font-size: 14px; }
.bio p { margin: 2px 0 0; white-space: pre-line; }
.display-name { font-weight: 600; }
.bio-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: #e0f1ff; font-weight: 600; }

/* Highlights (kategoriler) */
.highlights { display: flex; gap: 30px; max-width: var(--max); margin: 0 auto; padding: 0 40px 44px; overflow-x: auto; scrollbar-width: none; }
.highlights::-webkit-scrollbar { display: none; }
.hl { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 87px; flex: none; }
.hl-ring { display: block; width: 87px; height: 87px; padding: 4px; border-radius: 50%; border: 1px solid var(--line); transition: border-color .15s; }
.hl-img { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #262626; }
.hl-img img { width: 100%; height: 100%; object-fit: cover; }
.hl-name { max-width: 100%; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl:hover .hl-ring { border-color: rgba(255, 255, 255, .35); }
.hl.is-active .hl-ring { border: 2px solid var(--text); padding: 3px; }

/* Tabs + grid */
.gallery { max-width: var(--max); margin: 0 auto; padding: 0 20px 40px; width: 100%; }
.tabs { display: flex; justify-content: center; gap: 60px; border-top: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 52px; margin-top: -1px; border-top: 1px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.tab .i { width: 12px; height: 12px; }
.tab.is-active { color: var(--text); border-top-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.grid.is-loading { opacity: .5; transition: opacity .2s; }
.tile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #1a1f24; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 28px; background: rgba(0, 0, 0, .35); color: #fff; font-weight: 700; font-size: 16px; opacity: 0; transition: opacity .15s; }
.tile-hover span { display: inline-flex; align-items: center; gap: 6px; }
.tile-hover .i { width: 20px; height: 20px; }
.tile:hover .tile-hover, .tile:focus-visible .tile-hover { opacity: 1; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 60px 20px; text-align: center; }
.empty-ico { display: grid; place-items: center; width: 62px; height: 62px; border: 2px solid var(--text); border-radius: 50%; margin-bottom: 12px; }
.empty-ico .i { width: 30px; height: 30px; }
.empty h2 { margin: 0; font-size: 26px; font-weight: 800; }
.empty p { margin: 6px 0 0; color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 24px; }

/* Post */
.post-wrap { max-width: 1020px; margin: 0 auto; padding: 24px 20px 40px; width: 100%; }
.post {
  display: grid; grid-template-columns: minmax(0, auto) 335px; grid-template-rows: auto 1fr;
  grid-template-areas: "media head" "media side";
  width: fit-content; max-width: 100%; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.post-head { grid-area: head; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.post-user { display: inline-flex; align-items: center; min-width: 0; font-size: 14px; }
.post-user b { font-weight: 600; }
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; margin-right: 10px; flex: none; background: #262626; }
.post-cat { color: var(--muted); font-size: 13px; }
.post-cat::before { content: '•'; margin-right: 8px; }
.post-dl-mini { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 14px; }
.post-dl-mini:hover { color: #fff; }
/* Kutu tam olarak görselin oranında: yükseklik ekrana sığar, genişlik orandan gelir */
.post-media {
  /* Genişlik sabit (alanı asla aşmaz); yükseklik en az görselin oranı kadar, sağ panel uzunsa ona kadar uzar.
     Görsel kutuyu doldurur, taşan kenar kırpılır: boş/siyah alan kalmaz. */
  --avail: min(640px, 100vw - 400px);
  --h: min(82vh, 780px, calc(var(--avail) / var(--r, 1)));
  grid-area: media; align-self: stretch; position: relative; overflow: hidden;
  width: calc(var(--h) * var(--r, 1)); max-width: 100%; min-width: 0; min-height: var(--h);
  background-color: #1a1f24;
}
.post-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.post-side { grid-area: side; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 0; }
.post-caption { display: flex; gap: 0; padding: 16px; flex: 1; overflow-y: auto; }
.post-caption p { margin: 0; }
.post-caption .verified { width: 14px; height: 14px; margin: 0 4px 0 3px; vertical-align: -2px; }
.post-title { font-weight: 400; }
.post-desc { margin-top: 8px !important; white-space: pre-line; }
.post-time { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.post-foot { padding: 6px 16px 16px; border-top: 1px solid var(--line); }
.post-icons { display: flex; gap: 6px; margin: 0 -8px; }
.post-icons > * { display: grid; place-items: center; width: 40px; height: 40px; }
.post-icons > *:hover { opacity: .6; }
.post-count { margin: 4px 0 0; font-size: 14px; }
.post-count b { font-weight: 600; }
.post-date { margin: 4px 0 14px; color: var(--muted); font-size: 10px; letter-spacing: .2px; }
.inapp { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--btn); font-size: 13px; }
.inapp p { margin: 0; }
.inapp .i { margin-top: 1px; color: var(--blue); }
.ios-tip { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.ios-tip a { color: var(--text); font-weight: 600; text-decoration: underline; }
.related { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.related h2 { margin: 0 0 20px; color: var(--muted); font-size: 14px; font-weight: 600; }
.related h2 a { color: var(--text); }

/* Instagram tarzı akış (gönderi sayfasının altında) */
.feed { max-width: 470px; margin: 28px auto 0; }
.feed-list { display: grid; gap: 0; }
.feed-post { border-top: 1px solid var(--line); padding: 8px 0 22px; }
.feed-post .post-head { border: 0; padding: 12px 4px 10px; }
.feed-media { position: relative; display: block; aspect-ratio: var(--r, 1); width: min(100%, calc(85vh * var(--r, 1))); margin: 0 auto; background: #1a1f24 center / cover no-repeat; border-radius: 4px; overflow: hidden; }
.feed-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed-body { padding: 6px 4px 0; }
.feed-body .post-icons { margin: 0 -8px; }
.feed-caption { margin: 6px 0 0; font-size: 14px; }
.feed-caption b { font-weight: 600; }
.feed-caption .verified { width: 14px; height: 14px; margin: 0 4px 0 3px; vertical-align: -2px; }
.feed-caption a:hover { text-decoration: underline; }
.feed-body .post-desc { margin: 6px 0 0; font-size: 14px; }
.feed-body .post-date { margin: 6px 0 12px; }
.feed-more { display: grid; place-items: center; padding: 26px 0; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed-end { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0 6px; border-top: 1px solid var(--line); margin: 0; }
.feed-end a { color: var(--text); font-weight: 600; }

/* Lightbox & toast */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, .9); cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; color: #fff; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60; translate: -50% 12px; padding: 12px 18px; border-radius: 8px; background: #262626; color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.toast.is-on { opacity: 1; translate: -50% 0; }

/* Footer */
.site-footer { padding: 24px 20px 40px; text-align: center; color: var(--muted); font-size: 12px; }
.site-footer p { margin: 6px 0 0; }
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a:hover { text-decoration: underline; }
.notfound { max-width: 600px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.notfound h1 { font-size: 22px; font-weight: 600; }
.notfound a { color: #e0f1ff; }

/* ===================== Hareket (motion) ===================== */
/* Sayfalar arası yumuşak geçiş; ızgaradaki kare gönderi görseline dönüşür (destekleyen tarayıcılarda) */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.post-media { background-position: center; background-size: cover; background-repeat: no-repeat; }
.post-media img { view-transition-name: post-media; }
::view-transition-group(post-media) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

.tab-ink { position: absolute; top: -1px; left: 0; height: 1px; width: 0; background: var(--text); opacity: 0; pointer-events: none; }
.tabs { position: relative; }
.tabs.has-ink .tab.is-active { border-top-color: transparent; }
.tabs.has-ink .tab-ink { opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.88); } }
@keyframes ring-draw { from { --ring: 0%; } }
@keyframes reveal-fallback { to { opacity: 1; transform: none; filter: none; } }
@keyframes drop { 0% { transform: none; } 35% { transform: translateY(6px); } 65% { transform: translateY(-2px); } 100% { transform: none; } }
@keyframes check-in { from { opacity: 0; transform: scale(.6); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.22); } 55% { transform: scale(.96); } }

@media (prefers-reduced-motion: no-preference) {
  /* Profil açılışı */
  .profile-photo { animation: pop-in .6s cubic-bezier(.2, .8, .2, 1) both; }
  .profile-photo::before { animation: ring-draw 1.1s .25s cubic-bezier(.65, 0, .35, 1) both; }
  .profile-row { animation: rise .55s .06s cubic-bezier(.2, .8, .2, 1) both; }
  .counts { animation: rise .55s .12s cubic-bezier(.2, .8, .2, 1) both; }
  .bio { animation: rise .55s .18s cubic-bezier(.2, .8, .2, 1) both; }
  .hl { animation: pop-in .5s cubic-bezier(.34, 1.4, .64, 1) both; animation-delay: .22s; }
  .hl:nth-child(2) { animation-delay: .27s; } .hl:nth-child(3) { animation-delay: .32s; } .hl:nth-child(4) { animation-delay: .37s; }
  .hl:nth-child(5) { animation-delay: .42s; } .hl:nth-child(6) { animation-delay: .47s; } .hl:nth-child(n+7) { animation-delay: .5s; }
  .tabs { animation: rise .5s .28s cubic-bezier(.2, .8, .2, 1) both; }
  .tab-ink { transition: transform .38s cubic-bezier(.2, .8, .2, 1), width .38s cubic-bezier(.2, .8, .2, 1); }

  /* Izgara: kareler kaydırdıkça sırayla belirir, görseller bulanıktan netleşir */
  .motion .tile { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .6s cubic-bezier(.2, .8, .2, 1), transform .6s cubic-bezier(.2, .8, .2, 1); animation: reveal-fallback 0s 2.5s forwards; }
  .motion .tile.in { opacity: 1; transform: none; animation: none; }
  .motion .tile img { opacity: 0; filter: blur(14px); transform: scale(1.06); transition: opacity .45s ease, filter .6s ease, transform .9s cubic-bezier(.2, .8, .2, 1); animation: reveal-fallback 0s 3s forwards; }
  .motion .tile img.loaded { opacity: 1; filter: none; transform: none; animation: none; }
  .tile:hover img.loaded { transform: scale(1.035); }
  .grid { transition: opacity .2s; }

  /* Gönderi */
  .feed-post { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
  .post-side > *, .post-foot > * { animation: rise .45s .08s cubic-bezier(.2, .8, .2, 1) both; }

  /* Dokunuş hissi */
  .ig-btn, .post-icons > *, .hl-ring, .card-dl, .topbar-ig { transition: background .15s, transform .18s cubic-bezier(.3, 1.4, .5, 1), opacity .15s, border-color .15s; }
  .ig-btn:active { transform: scale(.96); }
  .post-icons > *:active { transform: scale(.82); }
  .hl:active .hl-ring { transform: scale(.92); }
  .is-downloading .i { animation: drop .6s cubic-bezier(.3, 1.4, .5, 1); }
  .is-downloaded .i { animation: check-in .35s cubic-bezier(.3, 1.6, .5, 1); }
  .support-card.is-nudge .support-ico { animation: beat .9s cubic-bezier(.3, 1.6, .5, 1) 2; }
  .ig-btn-support:hover .i { animation: beat .8s cubic-bezier(.3, 1.6, .5, 1); }
  .toast { transition: opacity .25s, translate .35s cubic-bezier(.3, 1.4, .5, 1); }
}

/* Mobil (Instagram'ın kırılım noktası) */
@media (max-width: 735px) {
  .topbar-in { height: 54px; padding: 0 16px; }
  .brand-logo { height: 28px; }
  .profile {
    grid-template-columns: 77px minmax(0, 1fr); column-gap: 24px; padding: 16px 16px 0;
    grid-template-areas: "photo row" "bio bio" "counts counts";
  }
  .profile-photo { width: 86px; height: 86px; padding: 5px; margin: 0; align-self: center; }
  .profile-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-actions { width: 100%; }
  .profile-actions .ig-btn { flex: 1; padding: 0 10px; }
  .profile-actions .ig-btn-icon { flex: none; width: 34px; padding: 0; }
  .support-card { order: 6; margin: 12px 14px 0; }
  .support-cta { padding: 0 10px; }
  .bio { margin-top: 14px; }
  .counts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 14px -16px 0; padding: 12px 0; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--muted); }
  .counts b { display: block; color: var(--text); }
  .counts a { color: inherit; }
  .highlights { gap: 15px; padding: 16px 16px 16px; }
  .hl { width: 64px; gap: 6px; }
  .hl-ring { width: 64px; height: 64px; padding: 3px; }
  .hl.is-active .hl-ring { padding: 2px; }
  .gallery { padding: 0 0 30px; }
  .tabs { gap: 0; justify-content: space-around; }
  .tab span { display: none; }
  .tab .i { width: 24px; height: 24px; }
  .tab { height: 44px; padding: 0 30px; }
  .grid { gap: 2px; }
  .tile-hover { display: none; }

  .post-wrap { padding: 0 0 30px; }
  .post { display: flex; flex-direction: column; border: 0; border-radius: 0; }
  .post-head { border-left: 0; border-bottom: 0; padding: 10px 14px; }
  .post { width: auto; }
  .post-media { width: 100%; height: auto; min-height: 0; aspect-ratio: var(--r, 1); }
  .feed-media { width: 100%; }
  .post-side { border-left: 0; }
  .post-foot { display: contents; }
  .post-icons { order: 1; padding: 4px 14px 0; margin: 0 -8px; margin: 0; }
  .post-count { order: 2; padding: 0 14px; }
  .post-caption { order: 3; flex: none; padding: 6px 14px 0; overflow: visible; }
  .post-caption > .mini-avatar { display: none; }
  .post-date { order: 4; padding: 0 14px; }
  .inapp { order: 5; margin: 0 14px 12px; }
  .post-foot > .ig-btn-block { order: 6; width: auto; margin: 0 14px; }
  .ios-tip { order: 7; padding: 0 14px; }
  .related { margin-top: 30px; padding-top: 24px; }
  .feed { margin-top: 18px; }
  .feed-post .post-head { padding: 10px 14px; }
  .feed-media { border-radius: 0; }
  .feed-body { padding: 4px 14px 0; }
  .feed-body .post-icons { margin: 0 -8px; }
  .related h2 { padding: 0 14px; margin-bottom: 14px; }
}
