/* ============================================================
   Seymur Hasanov — personal site
   Two-column launcher: identity sidebar + categorized card grid.
   ============================================================ */

:root {
  --bg:        #efeeec;
  --panel:     #e7e6e3;
  --card:      #fbfbfa;
  --card-hover:#ffffff;
  --card-hover-bg: #eaf0ff;
  --hover-shadow: 0 8px 26px rgba(53,89,224,.18);
  --text:      #1b1a18;
  --muted:     #6c6960;
  --faint:     #9d998f;
  --accent:    #3559e0;
  --accent-2:  #4b6ef5;
  --rule:      #dcdad4;
  --card-rule: #e4e2dc;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html.dark {
  --bg:        #0e0f0d;
  --panel:     #161714;
  --card:      #1d1f1b;
  --card-hover:#24261f;
  --card-hover-bg: #1c2740;
  --hover-shadow: 0 8px 26px rgba(125,155,255,.16);
  --text:      #e9e7e0;
  --muted:     #9d998d;
  --faint:     #6b675f;
  --accent:    #7d9bff;
  --accent-2:  #9db4ff;
  --rule:      #2a2c27;
  --card-rule: #2c2e28;
}

* { box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }

/* ====================== LAYOUT ====================== */
.layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.4rem;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 2.4rem;
  align-items: start;
}

/* ====================== SIDEBAR ====================== */
.sidebar { position: sticky; top: 2.4rem; }

.id-card {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-rule);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  cursor: pointer;
  padding: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.id-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--hover-shadow);
}

.readme {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.3rem;
  transition: color .15s ease;
}
.readme:hover { color: var(--accent-2); }
.readme svg { width: 15px; height: 15px; transform: rotate(180deg); }
.id-sym { font-family: var(--mono); font-weight: 500; font-size: 2rem; letter-spacing: -.02em; color: var(--accent); }
.id-num { position: absolute; top: 8px; right: 11px; font-family: var(--mono); font-size: .62rem; color: var(--faint); }
.id-name { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; color: var(--faint); text-transform: lowercase; }

.s-name { font-size: 1.7rem; line-height: 1.1; font-weight: 500; letter-spacing: -.01em; margin: 0 0 .25rem; }
.s-by { font-family: var(--mono); font-size: .76rem; color: var(--muted); margin: 0 0 1.1rem; letter-spacing: .01em; }

.icon-row { display: flex; gap: .55rem; margin-bottom: 1.4rem; }
.icon-row a {
  width: 2.1rem; height: 2.1rem;
  border: 1px solid var(--rule); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: var(--card);
  transition: color .15s, border-color .15s, transform .15s;
}
.icon-row a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-row svg { width: 17px; height: 17px; }

.s-intro { font-size: 1.02rem; line-height: 1.55; margin: 0 0 1.4rem; color: var(--text); }
.s-intro em { font-style: italic; color: var(--accent); }
.s-intro .hl { color: var(--accent); font-weight: 500; font-style: normal; }

.s-card {
  background: var(--card);
  border: 1px solid var(--card-rule);
  border-radius: 13px;
  padding: 1.05rem 1.1rem;
  margin-bottom: 1.3rem;
}
.s-card p { margin: 0 0 .8rem; font-size: .94rem; line-height: 1.5; color: var(--muted); }
.s-card strong { color: var(--text); font-weight: 600; }
.s-cta {
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--accent);
}
.s-cta svg { width: 15px; height: 15px; }
.s-cta:hover { color: var(--accent-2); }

.s-foot { font-family: var(--mono); font-size: .68rem; line-height: 1.7; color: var(--faint); margin: 0; }

/* ====================== PANEL ====================== */
.panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 1.6rem 1.7rem 2rem;
  min-height: 80vh;
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.pill {
  font-family: var(--mono); font-size: .78rem;
  padding: .42rem .9rem; border-radius: 100px;
  border: 1px solid transparent; background: var(--card);
  color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { color: var(--text); border-color: var(--rule); }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
html.dark .pill.active { color: #0e0f0d; }

/* ---------- Category sections ---------- */
.cat { margin-bottom: 2.2rem; }
.cat:last-of-type { margin-bottom: .5rem; }
.cat.hidden { display: none; }

.cat-head {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .15em; color: var(--muted);
  margin-bottom: 1rem; padding-left: .15rem;
}
.cat-head .bar { width: 3px; height: 1.05rem; border-radius: 3px; background: var(--accent); }
.cat-count { color: var(--faint); letter-spacing: 0; }

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: .7rem;
}
.grid-life { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

.card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card);
  border: 1px solid var(--card-rule);
  border-radius: 14px;
  padding: 1rem .85rem .95rem;
  min-height: 138px;
  color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
/* Interactive hover on every card (reference-style blue highlight + glow) */
.card:hover {
  transform: translateY(-3px);
  background: var(--card-hover-bg);
  border-color: var(--accent);
  box-shadow: var(--hover-shadow);
}
.card:hover .card-ico { color: var(--accent); transform: scale(1.06); }
a.card { cursor: pointer; }

.card-ico {
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  margin-bottom: .6rem;
  transition: color .16s ease, transform .16s ease;
}
.card-ico svg { width: 30px; height: 30px; stroke-width: 1.5; }

.card-title {
  font-size: .88rem; font-weight: 500; letter-spacing: -.005em; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-family: var(--mono); font-size: .62rem; color: var(--faint); margin-top: .2rem; text-transform: uppercase; letter-spacing: .04em; }
.card-desc {
  font-size: .76rem; line-height: 1.38; color: var(--muted); margin-top: .35rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc.venue { font-style: italic; -webkit-line-clamp: 1; }
.card-desc.venue em { font-style: normal; }

.card-more { background: transparent; border-style: dashed; justify-content: center; }

.card-life .card-ico svg { width: 34px; height: 34px; }

/* Interest cards with a real photo: centered round thumbnail, same box size */
.card.has-photo .card-photo { display: block; margin-bottom: .85rem; }
.card.has-photo .card-photo img {
  display: block; width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--card-rule);
}

.panel-foot {
  font-family: var(--mono); font-size: .7rem; color: var(--faint);
  margin: 2rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--rule);
}

/* ====================== ABOUT MODAL ====================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: rgba(20,20,18,.38);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 30rem;
  background: var(--card);
  border: 1px solid var(--card-rule);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  padding: 1.6rem 1.7rem 1.8rem;
  max-height: 85vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.modal-head .section-label { margin: 0; }
.modal-close {
  width: 2rem; height: 2rem; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--bg);
  color: var(--muted); cursor: pointer; font-size: .9rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-body p { margin: 0 0 1rem; font-size: 1.02rem; line-height: 1.6; color: var(--text); }
.modal-body p em { font-style: italic; color: var(--accent); }

.modal-card {
  display: flex; align-items: center; gap: .85rem;
  border: 1px solid var(--card-rule); border-radius: 12px;
  padding: .85rem 1rem; margin: 1.3rem 0 .5rem; color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.modal-card:hover { border-color: var(--accent); background: var(--card-hover-bg); transform: translateY(-1px); }
.modal-card-ico { display: flex; color: var(--accent); }
.modal-card-ico svg { width: 22px; height: 22px; }
.modal-card-text { display: flex; flex-direction: column; flex: 1; }
.modal-card-text strong { font-weight: 600; font-size: .98rem; }
.modal-card-text span { font-size: .82rem; color: var(--muted); }
.modal-card > svg { width: 16px; height: 16px; color: var(--faint); }

.modal-rule { border: none; border-top: 1px solid var(--rule); margin: 1.4rem 0; }
.modal-links { display: flex; flex-direction: column; gap: .8rem; }
.modal-links a {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .85rem; color: var(--muted);
}
.modal-links a:hover { color: var(--accent); }
.modal-links svg { width: 17px; height: 17px; }

/* ====================== THEME TOGGLE ====================== */
#theme-toggle {
  position: fixed; top: 1.1rem; right: 1.1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--card);
  color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 50;
  transition: color .15s, border-color .15s;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-icon-dark { display: none; }
html.dark .theme-icon-light { display: none; }
html.dark .theme-icon-dark { display: inline; }

/* ====================== INNER PAGES ====================== */
.narrow { max-width: 44rem; margin: 0 auto; padding: 4.5rem 1.5rem 4rem; }
.back { font-family: var(--mono); font-size: .8rem; margin: 0 0 2rem; }
.page-title { font-size: 1.9rem; line-height: 1.2; font-weight: 500; letter-spacing: -.01em; margin: 0 0 .75rem; }
.page-authors { color: var(--text); margin: 0 0 .35rem; }
.page-meta { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.page-meta .venue { font-family: var(--serif); font-style: italic; font-size: .95rem; }
.links { display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--mono); font-size: .82rem; }
.page-links { margin-bottom: 2rem; }
.page-hero { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--card-rule); margin: .5rem 0 2rem; }
.section-label { font-family: var(--mono); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; color: var(--faint); margin: 0 0 1rem; }
.abstract { margin: 2rem 0; }
.abstract p { color: var(--muted); }
.page-body { margin-top: 2rem; }
.page-body h2 { font-weight: 500; font-size: 1.3rem; margin-top: 2rem; }
.page-body img { max-width: 100%; height: auto; border-radius: 4px; }
.page-body h3 { font-weight: 500; font-size: 1.1rem; margin-top: 1.6rem; }
.page-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; }
.page-body th, .page-body td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); }
.page-body th { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.page-body code { font-family: var(--mono); font-size: .88em; background: var(--card); padding: .1rem .35rem; border-radius: 4px; }
.page-body ul, .page-body ol { padding-left: 1.2rem; }
.page-body li { margin: .3rem 0; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry { margin-bottom: 1.6rem; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .25rem; }
.entry-title { font-size: 1.05rem; font-weight: 500; }
.entry-meta { font-family: var(--mono); font-size: .74rem; color: var(--faint); white-space: nowrap; }
.entry-desc { margin: 0; color: var(--muted); font-size: .98rem; }
.entry-desc.venue { font-style: italic; }
.entry-links { margin: .3rem 0 0; font-family: var(--mono); font-size: .78rem; }
.tags { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { font-family: var(--mono); font-size: .72rem; color: var(--muted); background: var(--card); border: 1px solid var(--rule); border-radius: 100px; padding: .2rem .7rem; }
.callout { background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px; padding: .8rem 1rem; margin: 1.5rem 0; }
.intro { font-size: 1.1rem; color: var(--muted); }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 1.6rem; padding: 1.4rem; }
  .sidebar { position: static; }
  .id-card { margin-bottom: 1rem; }
}
@media (max-width: 540px) {
  html { font-size: 16px; }
  .panel { padding: 1.2rem 1rem 1.6rem; border-radius: 16px; }
  .grid, .grid-life { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .card { padding: .9rem; }
}
@media (max-width: 380px) {
  .grid, .grid-life { grid-template-columns: 1fr; }
}
