/* ============================================================
   CEYDA DUZGEC · BLOG — same tokens as ceydaduzgec.com
   Electric Lime · DM Sans · JetBrains Mono · Custom cursor
   ============================================================ */

:root {
  --bg:        #090907;
  --surface:   #0f0f0c;
  --card:      #151512;
  --border:    #272723;
  --border-hi: #3a3a34;

  --lime:      #c8ff00;
  --lime-dim:  rgba(200,255,0,0.08);
  --lime-glow: rgba(200,255,0,0.2);

  --text:      #efecea;
  --muted:     #b8b5aa;
  --dim:       #8a8680;
  --nav-bg:    rgba(9,9,7,0.88);

  --font:      'DM Sans', sans-serif;
  --body:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;

  --nav-h:     62px;
  --wrap:      1080px;
  --narrow:    720px;
  --r:         10px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --t:         0.3s;
}

:root.theme-light {
  --bg:        #f5f5f3;
  --surface:   #efefec;
  --card:      #e8e8e5;
  --border:    #d5d5cf;
  --border-hi: #c0c0b8;
  --lime:      #7a8f00;
  --lime-dim:  rgba(122,143,0,0.12);
  --lime-glow: rgba(122,143,0,0.25);
  --text:      #1a1918;
  --muted:     #5a5652;
  --dim:       #6f6b66;
  --nav-bg:    rgba(245,245,243,0.92);
}

:root.theme-colorblind {
  --bg:        #0a0a0a;
  --surface:   #1a1a1a;
  --card:      #252525;
  --border:    #3a3a3a;
  --border-hi: #505050;
  --lime:      #ffb81c;
  --lime-dim:  rgba(255,184,28,0.1);
  --lime-glow: rgba(255,184,28,0.25);
  --text:      #ffffff;
  --muted:     #d0d0d0;
  --dim:       #a0a0a0;
  --nav-bg:    rgba(10,10,10,0.9);
}

:root.theme-colorblind.theme-light {
  --bg:        #ffffff;
  --surface:   #f8f8f8;
  --card:      #f0f0f0;
  --border:    #d0d0d0;
  --border-hi: #b0b0b0;
  --lime:      #0173b2;
  --lime-dim:  rgba(1,115,178,0.12);
  --lime-glow: rgba(1,115,178,0.25);
  --text:      #000000;
  --muted:     #505050;
  --dim:       #707070;
  --nav-bg:    rgba(255,255,255,0.92);
}

/* ─── Reset ─────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--body); cursor: none; }
::selection { background: var(--lime); color: #000; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 2rem; }
.wrap-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 2rem; }

/* ─── Accessibility ──────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 0;
  padding: 0.5rem 1.25rem;
  background: var(--lime); color: #000;
  font-weight: 600; font-size: 0.9rem;
  z-index: 9999;
  border-radius: 0 0 var(--r) var(--r);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 3px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }

/* ─── Custom Cursor ──────────────────────────────────────── */
.cur {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--lime);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear, width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.3s;
  mix-blend-mode: difference;
}
.cur.big { width: 48px; height: 48px; }
.cur.hidden { opacity: 0; }

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 200;
  transition: background var(--t), border-color var(--t);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 2rem;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { font-family: var(--mono); font-size: 1.1rem; font-weight: 500; display: flex; align-items: baseline; gap: 1px; }
.nl-tilde { color: var(--lime); animation: tPulse 2.5s ease-in-out infinite; }
.nl-path { color: var(--dim); }
@keyframes tPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.nav-menu { display: flex; align-items: center; gap: 2rem; margin-left: auto; }
.nlink {
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.02em;
  transition: color var(--t);
}
.nlink:hover { color: var(--text); }
.nlink-cta {
  color: var(--bg) !important; background: var(--lime);
  padding: 0.38rem 1rem; border-radius: 5px; font-size: 0.85rem;
  transition: opacity var(--t) !important;
}
.nlink-cta:hover { opacity: 0.85; }

.nav-controls { display: flex; align-items: center; gap: 1rem; }
.nav-burger { display: none; flex-direction: column; gap: 6px; background: none; border: none; padding: 4px; }
.nav-burger span { display: block; width: 22px; height: 1.5px; background: var(--text); border-radius: 1px; transition: transform var(--t); }
.nav-burger.open span:first-child { transform: rotate(45deg) translate(5px,5px); }
.nav-burger.open span:last-child  { transform: rotate(-45deg) translate(5px,-5px); }

.theme-picker { position: relative; }
.tp-btn {
  display: flex; align-items: center; gap: 0.45rem;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  font-family: var(--mono); font-size: 0.75rem;
  padding: 0.4rem 0.65rem; border-radius: 5px;
  transition: border-color var(--t); white-space: nowrap;
}
.tp-btn:hover { border-color: var(--lime); }
.tp-icon { color: var(--lime); font-size: 0.85rem; line-height: 1; }
.tp-chevron { color: var(--dim); transition: transform var(--t); flex-shrink: 0; }
.theme-picker.open .tp-chevron { transform: rotate(180deg); }
.tp-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.3rem; min-width: 150px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--t), transform var(--t);
  z-index: 300; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.theme-picker.open .tp-menu { opacity: 1; transform: translateY(0); pointer-events: all; }
.tp-opt {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.65rem; border-radius: 5px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  transition: background var(--t), color var(--t); white-space: nowrap; cursor: none;
}
.tp-opt:hover { background: var(--surface); color: var(--text); }
.tp-opt.active { color: var(--lime); }
.tp-opt::before { content: ''; display: inline-block; width: 0.7rem; font-size: 0.65rem; }
.tp-opt.active::before { content: '✓'; }

/* ─── Shared type ────────────────────────────────────────── */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--surface); }
.sec-label {
  font-family: var(--mono); font-size: 0.72rem; color: var(--lime);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 0.9rem; display: block;
}
.sec-h2 {
  font-family: var(--font); font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800; letter-spacing: -0.01em; line-height: 1.1;
  margin-bottom: 2.5rem;
}
em { font-style: italic; }
.sec-h2 em, .intro-h1 em, .pc-title em, .post-title em { color: var(--lime); font-weight: 700; }

.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.reveal-up.in { opacity: 1; transform: none; }
.no-js .reveal-up { opacity: 1; transform: none; }

/* ─── Intro ──────────────────────────────────────────────── */
.intro {
  padding: calc(var(--nav-h) + 6rem) 0 4.5rem;
  position: relative;
  overflow: hidden;
}
.intro::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 20% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 20% 30%, #000 0%, transparent 70%);
  pointer-events: none;
}
.intro .wrap { position: relative; }
.intro-h1 {
  font-family: var(--font);
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 14ch;
  margin-bottom: 1.75rem;
}
.intro-p { max-width: 56ch; color: var(--muted); font-size: 1.075rem; }

.stats {
  display: flex; gap: 0;
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { flex: 1; padding: 1.25rem 0; border-right: 1px solid var(--border); padding-left: 1.5rem; }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; }
.stat dt { font-family: var(--mono); font-size: 0.7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
.stat dd { font-family: var(--font); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.2rem; }

/* ─── Post cards ─────────────────────────────────────────── */
.pc {
  display: block;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  transition: border-color var(--t);
  position: relative;
}
.pc-list .pc-wrap:last-child .pc { border-bottom: 1px solid var(--border); }
.pc:hover { border-top-color: var(--lime); }
.pc-top { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.pc-num { font-family: var(--mono); font-size: 0.75rem; color: var(--lime); }
.pc-cat {
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.pc-badge {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #000; background: var(--lime);
  padding: 0.18rem 0.5rem; border-radius: 4px;
}
.pc-title {
  font-family: var(--font); font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700; line-height: 1.2; letter-spacing: -0.015em;
  max-width: 30ch;
  transition: color var(--t);
}
.pc:hover .pc-title { color: var(--lime); }
.pc:hover .pc-title em { color: inherit; }
.pc-excerpt { color: var(--muted); max-width: 62ch; margin-top: 0.65rem; }
.pc-meta {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.72rem; color: var(--dim);
  margin-top: 1rem;
}
.pc-sep { color: var(--border-hi); }

.pc-featured {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(1.75rem, 4vw, 3rem);
  overflow: hidden;
}
.pc-featured::after {
  content: '';
  position: absolute; right: -80px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: var(--lime-glow);
  filter: blur(80px);
  opacity: 0.6;
  pointer-events: none;
}
.pc-featured:hover { border-color: var(--lime); }
.pc-featured .pc-title { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; max-width: 22ch; }
.pc-featured .pc-excerpt { font-size: 1.05rem; }
.pc-cta { margin-left: auto; color: var(--lime); font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.chip {
  font-family: var(--mono); font-size: 0.72rem;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.85rem;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.chip:hover { color: var(--text); border-color: var(--border-hi); }
.chip.active { color: #000; background: var(--lime); border-color: var(--lime); }
.pc-wrap[hidden] { display: none; }
.empty { color: var(--dim); font-family: var(--mono); font-size: 0.85rem; padding: 2rem 0; border-top: 1px solid var(--border); }
.empty a { color: var(--lime); }

/* ─── Post page ──────────────────────────────────────────── */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--lime); z-index: 400;
}
.post-head { padding-top: calc(var(--nav-h) + 4.5rem); padding-bottom: 2.5rem; border-bottom: 1px solid var(--border); margin-bottom: 3rem; }
.post-back { display: inline-block; font-family: var(--mono); font-size: 0.75rem; color: var(--dim); margin-bottom: 2rem; transition: color var(--t); }
.post-back:hover { color: var(--lime); }
.post-title {
  font-family: var(--font); font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -0.025em;
}
.post-lede { color: var(--muted); font-size: 1.15rem; margin-top: 1.25rem; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.75rem; color: var(--dim); margin-top: 1.75rem; }
.post-tags { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { color: var(--muted); }

.prose { font-size: 1.06rem; line-height: 1.8; color: var(--text); }
.prose > * + * { margin-top: 1.35rem; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font); letter-spacing: -0.015em; line-height: 1.25; }
.prose h2 { font-size: 1.75rem; font-weight: 800; margin-top: 3.25rem; }
.prose h3 { font-size: 1.3rem; font-weight: 700; margin-top: 2.5rem; }
.prose h2::before { content: '§ '; color: var(--lime); font-family: var(--mono); font-size: 0.8em; font-weight: 500; }
.prose a { color: var(--lime); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: '→'; position: absolute; left: -1.4rem; color: var(--lime); font-family: var(--mono); font-size: 0.85em; top: 0.15em; }
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--lime); font-family: var(--mono); font-size: 0.85em; }
.prose li + li { margin-top: 0.45rem; }
.prose blockquote {
  border-left: 2px solid var(--lime);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--muted); font-style: italic;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }
.prose img { border-radius: var(--r); border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
.prose th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); font-weight: 500; }

.prose code { font-family: var(--mono); font-size: 0.86em; }
.prose :not(pre) > code {
  background: var(--card); border: 1px solid var(--border);
  padding: 0.1em 0.4em; border-radius: 4px; color: var(--lime);
}
.prose pre {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1.1rem 1.25rem; overflow-x: auto; line-height: 1.6; font-size: 0.92rem;
}
.prose .highlighter-rouge { position: relative; }
.prose div.highlighter-rouge::before {
  content: attr(data-lang);
  position: absolute; top: 0.5rem; right: 0.75rem;
  font-family: var(--mono); font-size: 0.65rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* Rouge syntax tokens mapped onto theme colours */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: var(--dim); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .nt { color: var(--lime); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .si, .highlight .sx { color: #e6c07b; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .il { color: #f08d71; }
.highlight .na, .highlight .nb, .highlight .nf, .highlight .nx { color: #8fc8ff; }
.highlight .o, .highlight .p { color: var(--muted); }
:root.theme-light .highlight .s, :root.theme-light .highlight .s1, :root.theme-light .highlight .s2 { color: #9a6700; }
:root.theme-light .highlight .m, :root.theme-light .highlight .mi { color: #b5452a; }
:root.theme-light .highlight .na, :root.theme-light .highlight .nb, :root.theme-light .highlight .nf, :root.theme-light .highlight .nx { color: #0b5cad; }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 4.5rem; padding-top: 2rem; padding-bottom: 5rem;
  border-top: 1px solid var(--border);
}
.pn {
  display: block; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--t);
}
.pn:hover { border-color: var(--lime); }
.pn-next { text-align: right; grid-column: 2; }
.pn .sec-label { margin-bottom: 0.4rem; }
.pn-title { font-family: var(--font); font-weight: 700; line-height: 1.3; }

/* ─── Footer ─────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.ft-about p { color: var(--muted); max-width: 42ch; font-size: 0.95rem; }
.ft-about a { color: var(--lime); }
.ft-col li + li { margin-top: 0.4rem; }
.ft-col li a { font-size: 0.9rem; color: var(--muted); transition: color var(--t); }
.ft-col li a:hover { color: var(--lime); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem;
  margin-top: 3rem; padding-top: 1.5rem; padding-bottom: 1.5rem;
  border-top: 1px solid var(--border);
}
.footer-name { font-family: var(--font); font-size: 0.9rem; font-weight: 700; }
.footer-loc { font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-h: 58px; }
  .wrap, .wrap-narrow, .nav-inner { padding-left: 1rem; padding-right: 1rem; }
  .section { padding: 4rem 0; }
  .intro { padding-top: calc(var(--nav-h) + 3.5rem); }

  .nav-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 0.5rem 0 1rem;
    transform: translateY(-110%); opacity: 0; pointer-events: none;
    transition: transform var(--t) var(--ease), opacity var(--t);
    border-bottom: 1px solid var(--border);
  }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: all; }
  .nlink { display: block; padding: 0.85rem 1rem; font-size: 1rem; }
  .nlink-cta { margin: 0.5rem 1rem; display: inline-flex; }
  .nav-burger { display: flex; }
  .tp-label { display: none; }

  .stat dd { font-size: 1.4rem; }
  .stat { padding-left: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .ft-about { grid-column: 1 / -1; }
  .post-nav { grid-template-columns: 1fr; }
  .pn-next { grid-column: 1; text-align: left; }
  .pc-cta { margin-left: 0; width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
  body, button, a, .tp-opt { cursor: auto; }
  .cur { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-up { opacity: 1; transform: none; transition: none; }
  .nl-tilde { animation: none; }
}
