/* ════════════════════════════════
   styles.css
   CV — Mohammad A. Reslan
   ════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ── */
:root {
  /* page colors */
  --bg:               #ddd8cc;
  --ink:              #15120d;
  --ink-2:            #686868;
  --ink-3:            #1a1815;
  --ink-4:            #000000;
  --rule:             #cbc5ba;
  --accent:           #000080;
  --link:             #2a4e82;

  /* win95 chrome */
  --win-bg:           #d4d0c8;
  --win-titlebar:     #c0c0c0;
  --win-title-fg:     #000000;
  --win-border-light: #ffffff;
  --win-border-mid:   #808080;
  --win-border-dark:  #404040;
  --win-btn-face:     #d4d0c8;
  --win-body-bg:      #f5f2eb;

  /* typography */
  --f:  "Arimo", sans-serif;
  --f2: "Cossette Texte", sans-serif;
  --f3: "Cascadia Mono", monospace;

  /* layout */
  --col-w: 82ch;
  --pad-x: 3.5rem;
}

/* DARK MODE disabled for now
@media (prefers-color-scheme: dark) { ... }
*/

/* ── BASE ── */
html {
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--f);
  line-height: 1;
  max-width: var(--col-w);
  margin: 0 auto;
  padding: 0 var(--pad-x) 6rem;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* ════════════════════════════════
   MASTHEAD
   ════════════════════════════════ */

.masthead {
  border-bottom: 2px solid var(--ink-2);
  padding: 3.5rem 0 0;
  margin-bottom: 2.2rem;
}

.masthead-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.7rem;
}

.masthead-name {
  font-family: var(--f2);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 0.4;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.masthead-role {
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}

.issue-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--ink);
  padding: 0.5rem 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.issue-bar nav { display: flex; gap: 1.5rem; }
.issue-bar nav a { color: var(--ink-3); text-decoration: none; letter-spacing: 0.08em; }
.issue-bar nav a:hover { color: var(--accent); }

/* ════════════════════════════════
   WIN95 WINDOW FRAME
   ════════════════════════════════ */

.win {
  margin-bottom: 1.6rem;
  border-top:    2px solid var(--win-border-light);
  border-left:   2px solid var(--win-border-light);
  border-right:  2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  background: var(--win-bg);
  padding: 3px;
}

.win-inner {
  border-top:    1px solid var(--win-border-mid);
  border-left:   1px solid var(--win-border-mid);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
}

.win-titlebar {
  background: var(--win-titlebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px 5px 6px;
  gap: 4px;
  user-select: none;
}

.win-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--win-title-fg);
  letter-spacing: 0.01em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.win-btn {
  width: 22px;
  height: 20px;
  background: var(--win-btn-face);
  border-top:    1px solid var(--win-border-light);
  border-left:   1px solid var(--win-border-light);
  border-right:  1px solid var(--win-border-dark);
  border-bottom: 1px solid var(--win-border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--ink);
  line-height: 1;
  padding-bottom: 1px;
  flex-shrink: 0;
}

.win-btn:active {
  border-top:    1px solid var(--win-border-dark);
  border-left:   1px solid var(--win-border-dark);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
}

.win-btn-min::after   { content: '–'; }
.win-btn-max::after   { content: '□'; font-size: 0.55rem; }
.win-btn-close::after { content: '✕'; font-size: 0.58rem; }
.win-btn-help::after  { content: '?'; font-size: 0.7rem; }

a.win-btn { text-decoration: none; }
a.win-btn:hover { color: var(--ink); }

.win-body {
  background: var(--win-body-bg);
  padding: 1.4rem 1.6rem 1.6rem;
  border-top:    2px solid var(--win-border-dark);
  border-left:   2px solid var(--win-border-dark);
  border-right:  2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  overflow: hidden;
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
}

.win.minimized .win-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.win.minimized .win-inner { border-bottom: none; }

/* ── research window — scrollable with fade ── */
#research .win-body {
  max-height: 400px;
  overflow-y: scroll;
  padding-bottom: 0;
  position: relative;
}

#research.minimized .win-body {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

#research .win-body-inner {
  padding-bottom: 1.6rem;
}

#research .win-body-fade {
  position: sticky;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, var(--win-body-bg));
  pointer-events: none;
  margin-top: -3rem;
}

#research .win-body::-webkit-scrollbar { width: 16px; }
#research .win-body::-webkit-scrollbar-track {
  background: var(--win-bg);
  border-left: 1px solid var(--win-border-dark);
}
#research .win-body::-webkit-scrollbar-thumb {
  background: var(--win-bg);
  border-top:    1px solid var(--win-border-light);
  border-left:   1px solid var(--win-border-light);
  border-right:  1px solid var(--win-border-dark);
  border-bottom: 1px solid var(--win-border-dark);
}

.win-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.6em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 1.2rem;
}

/* ════════════════════════════════
   ABOUT
   ════════════════════════════════ */

.body-text p {
  font-size: 0.97rem;
  color: var(--ink);
  margin-bottom: 0.9rem;
  line-height: 1.65;
}

.body-text p:last-child { margin-bottom: 0; }

/* ════════════════════════════════
   EDUCATION
   ════════════════════════════════ */

.entry {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.2rem 1.5rem;
  margin-bottom: 1.4rem;
  align-items: start;
}

.entry:last-child { margin-bottom: 0; }

.entry-year {
  font-size: 0.65rem;
  color: var(--ink-3);
  padding-top: 0.28rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.entry-degree {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.entry-inst {
  font-size: 0.65rem;
  color: var(--ink-3);
  margin: 0.2rem 0 0.3rem;
  letter-spacing: 0.02em;
}

.entry-desc {
  font-size: 0.9rem;
  color: var(--ink-3);
  font-style: normal;
  line-height: 1.55;
}

.more-link {
  display: block;
  text-decoration: none;
  font-size: 0.6rem;
  color: var(--link);
  letter-spacing: 0.06em;
  font-family: var(--f3);
}

.more-link:hover { text-decoration: underline; }

/* ════════════════════════════════
   RESEARCH & PUBLICATIONS
   ════════════════════════════════ */

.pub {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.2rem 1.5rem;
  align-items: start;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
}

.pub:last-child { margin-bottom: 0; border-bottom: none; }

.pub-year {
  font-size: 0.65rem;
  color: var(--ink-3);
  padding-top: 0.28rem;
}

.pub-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
  margin-bottom: 0.28rem;
}

.pub-title em { font-style: italic; font-weight: 400; }

.pub-authors {
  font-size: 0.7rem;
  color: var(--ink-3);
  margin-bottom: 0.22rem;
  line-height: normal;
}

.pub-authors .self {
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pub-venue {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-style: italic;
}

.pub-venue a {
  font-size: 0.7rem;
  font-style: normal;
  color: var(--link);
}

.badge {
  display: inline-block;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid var(--ink-2);
  color: var(--ink-2);
  border-radius: 1px;
  margin-left: 6px;
  vertical-align: middle;
  font-style: normal;
}

a.badge { text-decoration: none; cursor: pointer; border-color: var(--ink); color: var(--ink); }
a.badge:hover { background: var(--ink); color: var(--win-body-bg); border-color: var(--ink); text-decoration: none; }

/* ════════════════════════════════
   SKILLS
   ════════════════════════════════ */

.skills-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.2rem;
}

.skill-group-name {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}

.skill-items {
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--ink-2);
}

.skill-link {
  color: var(--link);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  line-height: 1.5rem;
}

.skill-link:hover { color: var(--accent); }

/* ── notepad overlay ── */
#notepad-overlay {
  position: absolute;
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  max-width: calc(100vw - 16px);
}

.notepad {
  width: 380px;
  background: var(--win-body-bg);
  border-top:    2px solid var(--win-border-light);
  border-left:   2px solid var(--win-border-light);
  border-right:  2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
}

.notepad-inner {
  border-top:    1px solid var(--win-border-mid);
  border-left:   1px solid var(--win-border-mid);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
}

.notepad-titlebar {
  background: var(--win-titlebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 3px 6px;
}

.notepad-title {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--win-title-fg);
  flex: 1;
}

.notepad-btns { display: flex; gap: 2px; }

.notepad-menu {
  background: var(--win-bg);
  border-bottom: 1px solid var(--win-border-mid);
  padding: 2px 6px;
  display: flex;
  gap: 14px;
  font-size: 0.7rem;
  color: var(--ink-2);
  pointer-events: none;
}

.notepad-menu span {
  text-shadow: 1px 1px 0px var(--win-border-light), -0.5px -0.5px 0px var(--win-border-mid);
}

.notepad-body {
  background: var(--win-body-bg);
  border-top:    1px solid var(--win-border-dark);
  border-left:   1px solid var(--win-border-dark);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
  margin: 2px;
  padding: 10px;
  min-height: 120px;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.25;
  white-space: pre-wrap;
}

.notepad-statusbar {
  background: var(--win-bg);
  border-top: 1px solid var(--win-border-mid);
  padding: 2px 8px;
  font-size: 0.6rem;
  color: var(--ink-3);
}

/* ════════════════════════════════
   CONTACT
   ════════════════════════════════ */

.contact-list { display: flex; flex-direction: column; gap: 0.55rem; }

.contact-row { display: flex; gap: 0.75rem; align-items: baseline; }

.contact-key {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  min-width: 4rem;
}

.contact-val {
  font-size: 0.72rem;
  color: var(--ink-2);
}

.contact-val a { color: var(--link); text-decoration: none; }
.contact-val a:hover { color: var(--accent); text-decoration: underline; }

/* ════════════════════════════════
   BOTTOM ROW — contact + gallery button
   ════════════════════════════════ */

.bottom-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 0.6rem;
}

.win95-shortcut-wrap { width: 100%; }

.win95-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  background: var(--win-btn-face);
  border-top:    2px solid var(--win-border-light);
  border-left:   2px solid var(--win-border-light);
  border-right:  2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  text-decoration: none;
  font-size: 0.72rem;
  font-family: var(--f);
  color: var(--ink);
  letter-spacing: 0.04em;
}

.win95-shortcut:hover {
  color: var(--ink);
  text-decoration: none;
  filter: brightness(0.95);
}

.win95-shortcut:active {
  border-top:    2px solid var(--win-border-dark);
  border-left:   2px solid var(--win-border-dark);
  border-right:  2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
}

.win95-shortcut-icon { font-size: 1.4rem; line-height: 1; }
.win95-shortcut-label { font-weight: 400; }

.bottom-row #section-contact .win { margin-bottom: 0; }

/* ════════════════════════════════
   SCROLL PROGRESS BAR
   ════════════════════════════════ */

#scroll-progress {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(82ch - 7rem), calc(100vw - 2rem));
  z-index: 500;
  pointer-events: none;
  padding: 3px;
  background: var(--win-bg);
  border-top:    2px solid var(--win-border-light);
  border-left:   2px solid var(--win-border-light);
  border-right:  2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  opacity: 1;
  transition: opacity 0.4s ease;
}

#scroll-progress.hidden { opacity: 0; }

#scroll-progress-inner {
  border-top:    1px solid var(--win-border-mid);
  border-left:   1px solid var(--win-border-mid);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#scroll-progress-label {
  font-size: 0.58rem;
  font-family: var(--f);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  white-space: nowrap;
  min-width: 3rem;
}

#scroll-progress-track {
  flex: 1;
  height: 12px;
  background: var(--win-body-bg);
  border-top:    1px solid var(--win-border-dark);
  border-left:   1px solid var(--win-border-dark);
  border-right:  1px solid var(--win-border-light);
  border-bottom: 1px solid var(--win-border-light);
  position: relative;
  overflow: hidden;
}

#scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--win-titlebar);
  transition: width 0.1s linear;
}

#scroll-percent {
  font-size: 0.58rem;
  font-family: var(--f);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  min-width: 2.4rem;
  text-align: right;
}
/* ════════════════════════════════
   CONFERENCES
   ════════════════════════════════ */

.conf-entry {
  margin-bottom: 1.2rem;
}

.conf-entry:last-child { margin-bottom: 0; }

.conf-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.conf-year {
  font-size: 0.65rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.conf-type {
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid var(--ink-2);
  color: var(--ink-2);
  border-radius: 1px;
}

.conf-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.conf-link {
  display: block;
  text-decoration: none;
  font-size: 0.6rem;
  color: var(--link);
  letter-spacing: 0.06em;
  font-family: var(--f3);
}

.conf-link:hover { color: var(--accent); }

.conf-loc {
  font-size: 0.65rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.conf-detail {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ── conferences subsection ── */
.conf-subsection {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}

.conf-subsection-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.conf-subsection-desc {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: italic;
}

.conf-entry-retreat {
  margin-bottom: 0.6rem;
}

.conf-entry-retreat:last-child { margin-bottom: 0; }

.ext-link {
  text-decoration: none;
  font-size: 0.6rem;
  color: var(--link);
  letter-spacing: 0.06em;
  font-family: var(--f3);
}

.ext-link:hover {
  color: var(--accent);
  text-decoration: none;
}

#conferences .win-body {
  max-height: 400px;
  overflow-y: scroll;
  padding-bottom: 0;
  position: relative;
}

#conferences.minimized .win-body {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

#conferences .win-body-inner {
  padding-bottom: 1.6rem;
}

#conferences .win-body-fade {
  position: sticky;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, var(--win-body-bg));
  pointer-events: none;
  margin-top: -3rem;
}

#conferences .win-body::-webkit-scrollbar { width: 16px; }
#conferences .win-body::-webkit-scrollbar-track {
  background: var(--win-bg);
  border-left: 1px solid var(--win-border-dark);
}
#conferences .win-body::-webkit-scrollbar-thumb {
  background: var(--win-bg);
  border-top:    1px solid var(--win-border-light);
  border-left:   1px solid var(--win-border-light);
  border-right:  1px solid var(--win-border-dark);
  border-bottom: 1px solid var(--win-border-dark);
}

/* ════════════════════════════════
   FOOTER
   ════════════════════════════════ */

footer {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */

@media (max-width: 600px) {
  :root { --pad-x: 1rem; }

  .entry, .pub {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .entry-year, .pub-year { padding-top: 0; }

  .skills-block { grid-template-columns: 1fr; }

  .issue-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .issue-bar nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .bottom-row { grid-template-columns: 1fr 80px; }

  .contact-row { flex-wrap: wrap; }
  .contact-val { word-break: break-all; }

  #scroll-progress {
    width: calc(100vw - 2rem);
    bottom: 0.8rem;
  }

   .conf-entry {
   grid-template-columns: 1fr;
   gap: 0.1rem;
  }

  .conf-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
}
