/* ==========================================================================
   Emirhan Zeyrek — Site Stylesheet (Home, Apps showcase, 404)
   Independent from assets/style.css (used by App Store support/legal pages).
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --bg-elev: rgba(255, 255, 255, 0.025);
  --bg-elev-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededef;
  --text-2: #a1a1aa;
  --text-3: #6b6b74;
  --accent: #8b9cff;
  --green: #4ade80;
  --amber: #fbbf24;
  --nav-bg: rgba(10, 10, 11, 0.72);
  --glow: rgba(120, 130, 255, 0.10);
  --radius: 14px;
  --maxw: 680px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbfbfa;
    --bg-elev: rgba(0, 0, 0, 0.022);
    --bg-elev-hover: rgba(0, 0, 0, 0.04);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);
    --text: #18181b;
    --text-2: #52525b;
    --text-3: #8a8a93;
    --accent: #4f5bd5;
    --green: #16a34a;
    --amber: #b45309;
    --nav-bg: rgba(251, 251, 250, 0.75);
    --glow: rgba(99, 102, 241, 0.08);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-elev: rgba(0, 0, 0, 0.022);
  --bg-elev-hover: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #8a8a93;
  --accent: #4f5bd5;
  --green: #16a34a;
  --amber: #b45309;
  --nav-bg: rgba(251, 251, 250, 0.75);
  --glow: rgba(99, 102, 241, 0.08);
  color-scheme: light;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; cursor: default; user-select: none; }
.nav-brand img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 13.5px;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev-hover); }
.nav-links a[aria-current="page"] { color: var(--text); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-elev-hover); border-color: var(--border); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

/* ---------- Layout ---------- */
main { padding: 48px 0 60px; }
section { margin-bottom: 72px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.section-link { font-size: 13px; color: var(--text-2); transition: color .15s; }
.section-link:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1.5px var(--border-strong), 0 8px 24px rgba(0,0,0,.3), 0 0 20px rgba(56, 189, 248, 0.12);
  margin-bottom: 28px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  will-change: transform;
}
.hero-avatar:hover {
  transform: scale(1.06) !important;
  box-shadow: 0 0 0 2px #38bdf8, 0 12px 32px rgba(0,0,0,.4), 0 0 32px rgba(56, 189, 248, 0.28), 0 0 16px rgba(56, 189, 248, 0.35);
}
.hero-avatar:active {
  transform: scale(0.97) !important;
  transition-duration: 0.15s;
}
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  margin-bottom: 20px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); position: relative; flex-shrink: 0; }
.dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: currentColor; color: var(--green); opacity: .35;
  animation: ping 2s cubic-bezier(0,0,.2,1) infinite;
}
.dot.amber { background: var(--amber); }
.dot.amber::after { color: var(--amber); }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

.hero h1 {
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.hero .role { font-size: clamp(17px, 2.6vw, 20px); color: var(--text-3); letter-spacing: -0.02em; font-weight: 500; margin-top: 4px; }
.hero .bio { color: var(--text-2); font-size: 16px; margin-top: 20px; max-width: 560px; }
.hero .bio strong { color: var(--text); font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .15s, color .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { opacity: .88; }
.btn-ghost { border: 1px solid var(--border); color: var(--text-2); background: var(--bg-elev); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-icon { width: 38px; padding: 0; justify-content: center; }

/* ---------- App list (compact) ---------- */
.app-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -14px; }
.app-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: background .15s;
}
.app-row:hover { background: var(--bg-elev-hover); }
.app-row img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
.app-row .meta { flex: 1; min-width: 0; }
.app-row .name { font-weight: 500; font-size: 15px; letter-spacing: -0.01em; }
.app-row .desc { color: var(--text-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row .arrow { color: var(--text-3); transition: transform .2s, color .2s; flex-shrink: 0; }
.app-row:hover .arrow { transform: translateX(3px); color: var(--text); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}
a.badge:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- Stack grid ---------- */
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stack > div { background: var(--bg); padding: 18px 20px; }
.stack h3 { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 8px; letter-spacing: 0.02em; }
.stack p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }

/* ---------- Principles ---------- */
.principles li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.principles li:last-child { border-bottom: 1px solid var(--border); }
.principles .num { font-family: var(--mono); font-size: 12px; color: var(--text-3); padding-top: 2px; width: 22px; flex-shrink: 0; }
.principles strong { font-weight: 500; display: block; font-size: 14.5px; }
.principles span { color: var(--text-2); font-size: 13.5px; }

/* ---------- Project card ---------- */
.card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--border-strong); background: var(--bg-elev-hover); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title { font-weight: 500; font-size: 14.5px; }
.card p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.card .ext { color: var(--text-3); width: 15px; height: 15px; transition: transform .2s, color .2s; }
.card:hover .ext { color: var(--text); transform: translate(2px, -2px); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-elev-hover);
  border: 1px solid var(--border);
}

/* ---------- Apps showcase ---------- */
.showcase { padding-bottom: 40px; margin-bottom: 44px; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.showcase:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.showcase-head { display: flex; gap: 14px; align-items: center; }
.showcase-head img { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0,0,0,.18); flex-shrink: 0; }
.showcase-head .titles { flex: 1; min-width: 0; }
.showcase-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.showcase-head .sub { color: var(--text-3); font-size: 13px; }
.showcase > p { color: var(--text-2); margin-top: 14px; font-size: 14px; line-height: 1.6; }

.gallery-wrap { position: relative; margin: 20px 0 0 0; }
.gallery {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 8px 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  height: 275px; width: auto;
  aspect-ratio: 1206 / 2622;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border), 0 8px 20px rgba(0,0,0,.2);
  scroll-snap-align: start;
  flex-shrink: 0;
  background: var(--bg-elev);
}

.links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: 12.5px; }
.links a { color: var(--text-3); border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.links a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 28px 0 48px; font-size: 13px; color: var(--text-3); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text); }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
.notfound .code { font-family: var(--mono); color: var(--text-3); font-size: 13px; margin-bottom: 12px; }

/* ---------- Motion ---------- */
.reveal { animation: reveal .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.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;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .nav-brand { font-size: 13px; white-space: nowrap; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 13px; padding: 6px 7px; white-space: nowrap; }
  .theme-toggle { width: 30px; height: 30px; margin-left: 2px; }
  main { padding-top: 36px; }
  section { margin-bottom: 56px; }
  .stack { grid-template-columns: 1fr; }
  .showcase { padding-bottom: 30px; margin-bottom: 34px; }
  .showcase-head img { width: 44px; height: 44px; border-radius: 11px; }
  .gallery img { height: 230px; border-radius: 14px; }
  .app-row .badge { display: none; }
}
