/* =========================================================
   Network-science theme — Kadir Cihan Duran
   ========================================================= */
:root {
  --bg: #071224;
  --bg-2: #0b1a33;
  --surface: rgba(13, 29, 56, 0.72);
  --surface-solid: #0d1d38;
  --border: rgba(94, 234, 212, 0.14);
  --border-strong: rgba(94, 234, 212, 0.32);
  --text: #d7e3f1;
  --text-dim: #8fa3bf;
  --heading: #f1f7ff;
  --teal: #2dd4bf;
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --rose: #fb7185;
  --glow: 0 0 0 1px var(--border), 0 10px 30px -12px rgba(34, 211, 238, 0.25);
  --radius: 14px;
  --sidebar-w: 17.5rem;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(45, 212, 191, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(45, 212, 191, 0.35); color: #fff; }

#network-bg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}

a { color: var(--cyan); text-decoration: none; transition: color .2s, border-color .2s; border-bottom: 1px solid rgba(34, 211, 238, 0.25); }
a:hover { color: #fff; border-bottom-color: var(--teal); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.3rem; margin: 0 0 1rem; }
h2 { font-size: 1.55rem; margin: 2.6rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; }
p { margin: 0 0 1rem; }
strong { color: var(--heading); font-weight: 600; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }

/* Section heading with an "edge" running out of it */
.section-title {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.35rem; margin: 2.8rem 0 1.2rem;
}
.section-title::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15), 0 0 14px rgba(45, 212, 191, 0.6);
}
.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* Edge-style divider */
hr {
  border: 0; height: 1px; margin: 2.5rem 0; position: relative;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(9, 22, 44, 0.86), rgba(7, 18, 36, 0.92));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sidebar-inner { padding: 2.4rem 2rem; display: flex; flex-direction: column; min-height: 100%; }
.brand { display: flex; align-items: flex-start; gap: .7rem; border: 0; color: var(--heading); }
.brand:hover { color: #fff; }
.brand-node {
  width: 14px; height: 14px; margin-top: .55rem; border-radius: 50%; flex: none;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.15), 0 0 18px rgba(251, 191, 36, 0.55);
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.75rem; line-height: 1.15; }
.brand-desc { margin: 1rem 0 0; color: var(--text-dim); font-size: .92rem; line-height: 1.6; }

/* Nav = a path graph: dots joined by an edge */
.sidebar-nav { position: relative; margin: 2rem 0 0; padding-left: 4px; display: flex; flex-direction: column; gap: .3rem; }
.sidebar-nav::before {
  content: ""; position: absolute; left: 9px; top: 14px; bottom: 14px; width: 1px;
  background: linear-gradient(180deg, var(--border-strong), rgba(94, 234, 212, 0.08));
}
.nav-node {
  position: relative; display: flex; align-items: center; gap: .9rem;
  padding: .35rem .6rem .35rem 0; border: 0; color: var(--text-dim);
  font-weight: 500; font-size: .98rem;
}
.nav-node .dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none; z-index: 1;
  background: var(--bg); border: 2px solid rgba(94, 234, 212, 0.45);
  transition: transform .25s, background .25s, box-shadow .25s, border-color .25s;
}
.nav-node:hover { color: #fff; }
.nav-node:hover .dot { transform: scale(1.25); border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.6); }
.nav-node.active { color: var(--heading); }
.nav-node.active .dot { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18), 0 0 14px rgba(45, 212, 191, 0.7); }

.social-icons { display: flex; gap: .6rem; margin-top: 2rem; }
.social-icons a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(13, 29, 56, 0.6);
  color: var(--text-dim); transition: all .25s;
}
.social-icons svg { width: 17px; height: 17px; fill: currentColor; }
.social-icons a:hover { color: var(--bg); background: var(--teal); border-color: var(--teal); box-shadow: 0 0 16px rgba(45, 212, 191, 0.55); transform: translateY(-2px); }
.sidebar-foot { margin-top: auto; padding-top: 2rem; font-size: .72rem; color: var(--text-dim); opacity: .6; }

/* ---------- Content ---------- */
.content { position: relative; z-index: 1; padding: 3rem 1.5rem 6rem; }
.content > :first-child { margin-top: 0; }

@media (min-width: 52em) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); overflow-y: auto; }
  .content { margin-left: var(--sidebar-w); padding: 3.5rem 4rem 6rem; max-width: calc(var(--sidebar-w) + 900px); }
  .content > * { max-width: 860px; }
}
@media (max-width: 52em) {
  .sidebar-inner { padding: 1.6rem 1.4rem 1.4rem; }
  .brand-name { font-size: 1.45rem; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: .2rem 1.1rem; padding-left: 0; margin-top: 1.2rem; }
  .sidebar-nav::before { display: none; }
  .social-icons { margin-top: 1.2rem; }
  .sidebar-foot { display: none; }
  h1 { font-size: 1.9rem; }
}

/* Lists become node-and-edge paths */
.content ul { list-style: none; padding-left: 0; margin: 0 0 1.4rem; position: relative; }
.content ul > li { position: relative; padding: .45rem 0 .45rem 1.9rem; }
.content ul > li::before {
  content: ""; position: absolute; left: 3px; top: 1.05rem; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--teal);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.4);
}
.content ul > li:not(:last-child)::after {
  content: ""; position: absolute; left: 7px; top: 1.75rem; bottom: -0.5rem; width: 1px;
  background: rgba(94, 234, 212, 0.22);
}
.content ul.plain > li { padding-left: 0; }
.content ul.plain > li::before, .content ul.plain > li::after { display: none; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--glow); }

/* Buttons & chips */
.btn, .chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 500 .85rem/1 var(--font-body);
  padding: .6rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text); background: rgba(13, 29, 56, 0.75);
  transition: all .2s;
}
.btn:hover, .chip:hover { color: #fff; border-color: var(--teal); box-shadow: 0 0 16px -2px rgba(45, 212, 191, 0.5); }
.btn-primary { background: var(--teal); color: #04121f; border-color: var(--teal); font-weight: 600; }
.btn-primary:hover { background: #5eead4; color: #04121f; }
.chip[aria-pressed="true"] { border-color: var(--teal); color: #fff; background: rgba(45, 212, 191, 0.14); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); transition: background .2s, box-shadow .2s; }
.chip[aria-pressed="true"] .chip-dot { background: var(--teal); box-shadow: 0 0 10px var(--teal); }

.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font: 500 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
  padding: .3rem .55rem; border-radius: 6px; border: 1px solid var(--border); color: var(--text-dim);
}
.tag-published { color: var(--teal); border-color: rgba(45, 212, 191, 0.4); }
.tag-review { color: var(--amber); border-color: rgba(251, 191, 36, 0.4); }
.tag-working { color: var(--violet); border-color: rgba(167, 139, 250, 0.4); }

/* Background-network controls */
.net-controls {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 5;
  display: flex; flex-direction: column; align-items: flex-end; gap: .45rem;
}
.net-stats { font-size: .7rem; color: var(--text-dim); background: rgba(7, 18, 36, 0.8); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .6rem; display: none; }
.net-stats.show { display: block; }
@media (max-width: 52em) { .net-controls { right: .8rem; bottom: .8rem; } .chip-label { display: none; } .chip { padding: .6rem; } }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; margin-bottom: 1.5rem; }
.avatar-node { position: relative; width: 150px; height: 150px; }
.avatar-node img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid var(--amber); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.12), 0 0 40px rgba(251, 191, 36, 0.28); }
.avatar-node::before, .avatar-node::after {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 1px dashed rgba(251, 191, 36, 0.45); animation: spin 40s linear infinite;
}
.avatar-node::after { inset: -30px; border-style: solid; border-color: rgba(251, 191, 36, 0.14); animation-duration: 70s; animation-direction: reverse; }
.avatar-node .orbit-dot { position: absolute; inset: -16px; animation: spin 14s linear infinite; }
.avatar-node .orbit-dot::before { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { font: 500 .78rem/1 var(--font-mono); color: var(--teal); text-transform: uppercase; letter-spacing: .12em; margin-bottom: .7rem; }
.hero h1 { margin-bottom: .4rem; }
.hero .lede { color: var(--text-dim); margin: 0; }
.interests { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
@media (max-width: 40em) { .hero { grid-template-columns: 1fr; text-align: left; } .avatar-node { margin: 1rem 0 1rem 1rem; } }

.viz-card { padding: 0; overflow: hidden; }
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.3rem; border-bottom: 1px solid var(--border); }
.viz-head h3 { margin: 0; font-size: 1rem; }
.viz-head .dim { font-size: .82rem; }
.viz-foot { padding: .8rem 1.3rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-dim); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.viz-body { position: relative; }
.viz-body svg { display: block; width: 100%; height: auto; }
.controls { display: flex; gap: .4rem; flex-wrap: wrap; }
.controls .btn { padding: .45rem .8rem; font-size: .78rem; }

/* Ego network */
#ego-net { aspect-ratio: 2 / 1; }
@media (max-width: 40em) { #ego-net { aspect-ratio: 5 / 6; } }
#ego-net svg { width: 100%; height: 100%; }
.ego-link { stroke: rgba(94, 234, 212, 0.28); stroke-width: 1.4; transition: stroke .25s, stroke-width .25s; }
.ego-link.hot { stroke: var(--cyan); stroke-width: 2.2; }
.ego-link.weak { stroke-dasharray: 3 4; stroke: rgba(143, 163, 191, 0.25); }
.ego-node { cursor: pointer; }
.ego-node circle { transition: r .25s, fill .25s, stroke .25s; }
.ego-node text { font: 500 13px var(--font-body); fill: var(--text); pointer-events: none; }
.ego-node .sub { font: 400 10.5px var(--font-mono); fill: var(--text-dim); }
.ego-node:hover circle.core, .ego-node:focus circle.core { stroke: #fff; }
.ego-node:focus { outline: none; }
.ego-pulse { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }

/* GNN demo */
#gnn-demo { aspect-ratio: 2 / 1; }
#gnn-demo svg { width: 100%; height: 100%; }
.gnn-edge { stroke: rgba(143, 163, 191, 0.35); stroke-width: 1.5; }
.gnn-node { stroke: rgba(255,255,255,0.85); stroke-width: 1.5; transition: fill .6s; }
.gnn-node.labeled { stroke: #fff; stroke-width: 3; }
.gnn-msg { r: 3.5; }
.formula { font-family: var(--font-mono); font-size: .8rem; color: var(--text); }
.layer-pips { display: inline-flex; gap: .3rem; vertical-align: middle; margin-left: .4rem; }
.layer-pips span { width: 22px; height: 6px; border-radius: 3px; background: rgba(143, 163, 191, 0.25); transition: background .3s; }
.layer-pips span.on { background: var(--teal); box-shadow: 0 0 8px rgba(45, 212, 191, 0.6); }
.legend { display: inline-flex; gap: .9rem; align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }

/* ---------- Research ---------- */
#coauthor-net { height: 470px; }
#coauthor-net svg { width: 100%; height: 100%; cursor: grab; }
#coauthor-net svg:active { cursor: grabbing; }
.co-link { stroke: rgba(94, 234, 212, 0.35); }
.co-link.wip { stroke-dasharray: 6 5; stroke: rgba(94, 234, 212, 0.5); }
.co-link.topic { stroke: rgba(167, 139, 250, 0.35); stroke-dasharray: 3 3; }
.co-link.dim, .co-node.dim { opacity: .12; }
.co-link.hot { stroke: var(--cyan); opacity: 1; }
.co-node { cursor: pointer; transition: opacity .25s; }
.co-node text { font: 500 11.5px var(--font-body); fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.co-node.topic text { font: 500 10.5px var(--font-mono); fill: #d6ccff; }
.co-node.selected circle, .co-node.selected rect { stroke: #fff; stroke-width: 3; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .15s;
  background: rgba(7, 18, 36, 0.95); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: .6rem .75rem; font-size: .8rem; line-height: 1.45; max-width: 260px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.tooltip b { color: var(--heading); font-family: var(--font-head); font-size: .9rem; }
.tooltip .mono { color: var(--teal); font-size: .72rem; }
.metrics { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.metric { display: flex; flex-direction: column; }
.metric b { font: 600 1.05rem/1.1 var(--font-mono); color: var(--heading); }
.metric span { font: 400 .68rem/1.4 var(--font-mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }

.pub-filter-note { display: none; margin: 1.2rem 0 0; font-size: .85rem; color: var(--text-dim); }
.pub-filter-note.show { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pub-list { display: flex; flex-direction: column; gap: .9rem; }
.pub { display: grid; grid-template-columns: 4.2rem 1fr; gap: 1rem; transition: opacity .3s, border-color .25s, box-shadow .25s; }
.pub.faded { opacity: .28; }
.pub.match { border-color: var(--teal); box-shadow: var(--glow); }
.pub-year { font: 500 .9rem/1.6 var(--font-mono); color: var(--teal); }
.pub-title { font-family: var(--font-head); font-weight: 600; color: var(--heading); font-size: 1.05rem; line-height: 1.35; margin: 0 0 .35rem; }
.pub-authors { font-size: .88rem; color: var(--text-dim); margin: 0 0 .2rem; }
.pub-authors .me { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--teal); }
.pub-venue { font-size: .88rem; font-style: italic; color: var(--text); margin: 0; }
.pub-meta { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-top: .7rem; }
.pub-meta a.tag { color: var(--cyan); border-color: rgba(34, 211, 238, 0.4); }
.pub-meta a.tag:hover { background: rgba(34, 211, 238, 0.12); color: #fff; }
.topic-tag { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.3); }
@media (max-width: 40em) { .pub { grid-template-columns: 1fr; gap: .2rem; } #coauthor-net { height: 400px; } }

/* Timeline (awards) */
.section-title .count { font-size: .72rem; font-weight: 500; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: .15rem .5rem; }
.content ul.timeline > li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding-top: .55rem; padding-bottom: .55rem; }
.timeline .term { font-size: .78rem; color: var(--teal); padding-top: .15rem; }
.timeline .t-body { display: flex; flex-direction: column; }
.timeline .t-body .dim { font-size: .88rem; }
.timeline .t-body .tag { align-self: flex-start; margin-top: .35rem; }
@media (max-width: 40em) { .content ul.timeline > li { grid-template-columns: 1fr; gap: 0; } }

/* Research network legend lines */
.legend .ln { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--teal); vertical-align: middle; margin-right: .35rem; }
.legend .ln.dash { border-top-style: dashed; }

/* CV */
.cv-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.5rem 0; }

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