/* ============================================================
   SALIK SALAM — portfolio
   dark terminal / brutalist, phosphor-amber accent
   ============================================================ */

:root {
  --bg:        #070707;
  --bg-soft:   #0d0d0e;
  --panel:     #101011;
  --line:      #1d1d1f;
  --line-2:    #2a2a2d;
  --fg:        #ededed;
  --fg-dim:    #8a8a8f;
  --fg-faint:  #5a5a5e;
  --accent:    #ffae42;      /* phosphor amber */
  --accent-2:  #ff7a18;      /* deeper ember   */
  --accent-dim:#5a4220;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1180px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}

::selection { background: var(--accent); color: #000; }

a { color: inherit; text-decoration: none; }

em { font-style: normal; color: var(--accent); }

.label {
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* ---------- atmosphere: grain + vignette ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .04; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% -10%, transparent 50%, rgba(0,0,0,.65) 100%);
}

/* ============================== NAV ============================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(7,7,7,.72);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { color: var(--accent); display: block; transition: transform .3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-90deg); }
.brand-name { letter-spacing: .04em; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav-links a {
  font-size: 13px; color: var(--fg-dim); position: relative;
  transition: color .2s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 1px;
  width: 0; background: var(--accent); transition: width .25s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

/* ============================== LAYOUT ============================== */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); position: relative; z-index: 2; }
section { padding: clamp(56px, 9vw, 120px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

/* ============================== HERO ============================== */
.hero {
  padding-top: clamp(48px, 9vw, 100px);
}
.glitch {
  display: inline-block; white-space: nowrap;
  font-size: clamp(31px, 5.4vw, 62px);
  font-weight: 800; line-height: .95; letter-spacing: -.02em;
  position: relative; color: var(--fg);
  text-shadow: 3px 3px 0 var(--accent-dim);
  animation: rise .8s var(--ease) both;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  clip-path: inset(0); pointer-events: none;
}
.glitch::before { color: var(--accent-2); transform: translate(-3px,0); opacity: .55; mix-blend-mode: screen; animation: shift1 4s steps(2) infinite; }
.glitch::after  { color: #4fd6ff;       transform: translate(3px,0);  opacity: .35; mix-blend-mode: screen; animation: shift2 5.5s steps(2) infinite; }
@keyframes shift1 { 0%,92%,100%{transform:translate(-3px,0)} 94%{transform:translate(-7px,2px)} 96%{transform:translate(-1px,-2px)} }
@keyframes shift2 { 0%,90%,100%{transform:translate(3px,0)} 93%{transform:translate(8px,-2px)} 97%{transform:translate(2px,2px)} }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero-sub {
  margin-top: 18px; font-size: 13px; letter-spacing: .2em;
  color: var(--fg-dim); animation: rise .8s .1s var(--ease) both;
}
.hero-lede {
  font-size: 14.5px; line-height: 1.7; color: var(--fg-dim);
  max-width: 52ch; animation: rise .8s .2s var(--ease) both;
}
.hero-lede em { color: var(--fg); }

/* ============================== STRIP ============================== */
.strip {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(28px, 4vw, 44px);
}
.email-copy {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); text-align: left; color: var(--fg);
}
.email-text {
  font-size: clamp(17px, 2vw, 24px); font-weight: 700; letter-spacing: -.01em;
  border-bottom: 1px solid var(--line-2); padding-bottom: 3px;
  transition: color .2s, border-color .2s;
}
.email-copy:hover .email-text, .email-copy:focus-visible .email-text { color: var(--accent); border-color: var(--accent); }
.email-hint { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }
.email-copy.copied .email-hint { color: var(--accent); }

.links { display: flex; gap: 26px; flex-wrap: wrap; }
.links a {
  font-size: 15px; color: var(--fg-dim); position: relative;
  transition: color .2s var(--ease);
}
.links a::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 1px;
  width: 0; background: var(--accent); transition: width .25s var(--ease);
}
.links a:hover { color: var(--fg); }
.links a:hover::after { width: 100%; }

/* ============================== WORK / BOARD ============================== */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head .label { margin-bottom: 0; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; min-width: 240px;
  color: var(--fg-faint); transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search input { background: none; border: none; outline: none; color: var(--fg); font-family: var(--mono); font-size: 13px; flex: 1; }
.search input::placeholder { color: var(--fg-faint); }
.search kbd {
  font-family: var(--mono); font-size: 11px; color: var(--fg-faint);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px;
}

.board { width: 100%; border-collapse: collapse; }
.board thead th {
  text-align: left; font-size: 11px; letter-spacing: .18em; color: var(--fg-faint);
  font-weight: 500; padding: 0 16px 14px; border-bottom: 1px solid var(--line);
}
.c-rank { width: 48px; }
.c-tag  { width: 34%; }
.c-stat { width: 130px; text-align: right !important; }

.board tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease);
  cursor: pointer;
}
.board tbody tr:hover { background: var(--bg-soft); }
.board tbody td { padding: 18px 16px; vertical-align: middle; }
.board .rank { color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.board tr:hover .rank { color: var(--accent); }
.board .pname { font-weight: 700; font-size: 15px; }
.board .pdesc { color: var(--fg-dim); font-size: 12.5px; margin-top: 3px; }
.board .ptag { color: var(--fg-dim); font-size: 12.5px; }
.board .arrow { color: var(--fg-faint); transition: transform .2s var(--ease), color .2s; }
.board tr:hover .arrow { color: var(--accent); transform: translate(3px,-3px); }

.status { text-align: right; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: .04em; color: var(--fg-dim);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); }
.badge.live::before   { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge.wip::before    { background: #4fd6ff; box-shadow: 0 0 8px #4fd6ff; }
.badge.archived::before { background: var(--fg-faint); }

.board-empty { color: var(--fg-faint); padding: 28px 16px; font-size: 13px; }

/* ============================== RESEARCH ============================== */
.scholar-link { font-size: 13px; color: var(--fg-dim); border-bottom: 1px solid var(--line-2); padding-bottom: 3px; transition: color .2s, border-color .2s; }
.scholar-link:hover { color: var(--accent); border-color: var(--accent); }
.pubs { display: flex; flex-direction: column; }
.pub {
  display: grid; grid-template-columns: 64px 1fr 24px; gap: 20px; align-items: baseline;
  padding: 20px 16px; border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease);
}
.pub:hover { background: var(--bg-soft); }
.pub-year { color: var(--fg-faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.pub:hover .pub-year { color: var(--accent); }
.pub-title { display: block; font-weight: 700; font-size: 15px; line-height: 1.4; }
.pub-venue { display: block; color: var(--fg-dim); font-size: 12.5px; margin-top: 4px; }
.pub-arrow { color: var(--fg-faint); transition: transform .2s var(--ease), color .2s; align-self: center; }
.pub:hover .pub-arrow { color: var(--accent); transform: translate(3px,-3px); }

/* ============================== ABOUT ============================== */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 6vw, 80px); }
.about-text { font-size: clamp(14.5px, 1.2vw, 16px); line-height: 1.7; color: var(--fg); }
.about-text p + p { margin-top: 1.1em; color: var(--fg-dim); }
.facts { list-style: none; align-self: center; }
.facts li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts li:last-child { border-bottom: none; }
.fk { color: var(--fg-faint); letter-spacing: .1em; text-transform: uppercase; font-size: 11px; min-width: 62px; align-self: center; }
.fv { color: var(--fg-dim); }
.live { color: var(--accent); }

/* ============================== STACK ============================== */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: var(--fg-dim);
  transition: all .2s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--accent); transform: translateY(-2px); }

/* ============================== FOOTER ============================== */
.footer {
  max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 2;
  padding: clamp(64px,10vw,140px) clamp(20px,5vw,64px);
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end;
}
.footer-big {
  font-size: clamp(40px, 7vw, 80px); font-weight: 800; line-height: .9;
  letter-spacing: -.02em;
}
.footer-big .dot { color: var(--accent); }
.footer-meta { text-align: right; }
.cta {
  font-size: clamp(15px, 1.6vw, 19px); font-weight: 700; color: var(--fg);
  border-bottom: 2px solid var(--accent); padding-bottom: 4px;
  transition: color .2s;
}
.cta:hover { color: var(--accent); }
.copyright { margin-top: 22px; font-size: 12px; color: var(--fg-faint); }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 28px; }
  .strip, .about-grid, .footer { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
  .c-tag { display: none; }
  .nav-links { gap: 16px; }
  .nav-links a:nth-child(3) { display: none; }
  .pub { grid-template-columns: 48px 1fr 20px; gap: 12px; }
}
@media (max-width: 520px) {
  .nav-links a { font-size: 12px; }
  .c-stat { width: auto; }
}

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