/* ==========================================================================
   walidhassan.com
   Palette : deep space blue, one warm accretion note
   Type    : Calibri (Carlito is the metric-compatible open fallback)
   Surface : liquid glass — translucent, blurred, specular-edged
   ========================================================================== */

/* Carlito ships with LibreOffice and is metrically identical to Calibri.
   Drop the .woff2 files into /assets/fonts/ and these rules activate.
   If they are absent the stack simply falls through to Calibri / Segoe UI. */
@font-face {
  font-family: 'Carlito';
  src: url('/assets/fonts/carlito-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Carlito';
  src: url('/assets/fonts/carlito-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* ---- colour ---- */
  --void:    #01040e;
  --abyss:   #050d22;
  --navy:    #0b1a44;
  --cobalt:  #2f62ff;
  --halo:    #74d2ff;
  --ember:   #ffc27a;   /* accretion disc only — never in the UI */
  --ice:     #eaf1ff;
  --fog:     #8ea3d2;

  /* ---- glass ---- */
  --glass-tint:   linear-gradient(152deg,
                    rgba(126,174,255, .14) 0%,
                    rgba(24, 48,104, .26) 46%,
                    rgba(7, 17, 42, .34) 100%);
  --glass-edge:   rgba(154, 194, 255, .17);
  --glass-blur:   blur(30px) saturate(180%);
  --glass-lift:
      inset 0  1px 0 rgba(255,255,255,.22),
      inset 0 -1px 0 rgba(255,255,255,.05),
      inset 1px 0 0 rgba(255,255,255,.06),
      0 24px 60px rgba(1, 5, 20, .55),
      0  2px 10px rgba(1, 5, 20, .38);

  /* ---- type ---- */
  --sans: Calibri, Carlito, 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* ---- rhythm ---- */
  --radius:  26px;
  --radius-sm: 14px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 1080px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.7;
  color: var(--ice);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--halo); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .22em; }

:focus-visible {
  outline: 2px solid var(--halo);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  padding: .8rem 1.2rem; z-index: 999;
  background: var(--navy); color: var(--ice); border-radius: 0 0 12px 0;
}
.skip:focus { left: 0; }

/* ==========================================================================
   THE COSMIC FIELD
   Fixed behind everything: starfield canvas, spacetime lattice, black hole.
   ========================================================================== */
.cosmos {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 8%,  rgba(24, 56, 138, .55) 0%, rgba(6, 14, 38, 0) 62%),
    radial-gradient(90%  70% at 12% 88%, rgba(18, 40, 110, .40) 0%, rgba(4, 10, 28, 0) 60%),
    linear-gradient(180deg, var(--abyss) 0%, var(--void) 78%);
}

#starfield { position: absolute; inset: 0; width: 100%; height: 100%; }

/* --- spacetime lattice: the grid bends toward the singularity --- */
.grid-warp {
  position: absolute;
  left: 50%; bottom: -16vh;
  width: 260vw; height: 90vh;
  transform: translateX(-50%) perspective(620px) rotateX(74deg);
  transform-origin: 50% 100%;
  background-image:
    repeating-linear-gradient(90deg, rgba(116,210,255,.30) 0 1px, transparent 1px 7.5%),
    repeating-linear-gradient( 0deg, rgba(116,210,255,.22) 0 1px, transparent 1px 9%);
  -webkit-mask-image: radial-gradient(60% 78% at 50% 100%, #000 0%, transparent 78%);
          mask-image: radial-gradient(60% 78% at 50% 100%, #000 0%, transparent 78%);
  opacity: .28;
  animation: lattice-drift 26s linear infinite;
}
@keyframes lattice-drift { to { background-position: 0 9%, 0 9%; } }

/* --- the black hole --- */
.singularity {
  position: absolute;
  top: 9vh; left: 50%;
  width: min(76vmin, 720px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  perspective: 1000px;
  opacity: .9;
}

.singularity > span { position: absolute; border-radius: 50%; }

/* lensed far side of the disc, arcing up and over the horizon */
.disc--far {
  inset: 12%;
  background: conic-gradient(from 190deg,
      transparent 0deg,
      rgba(255,194,122,.00) 18deg,
      rgba(255,206,150,.80) 88deg,
      rgba(140,200,255,.62) 148deg,
      rgba(60,120,255,.20)  186deg,
      transparent 210deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 64%, #000 68%, #000 95%, transparent 100%);
          mask-image: radial-gradient(closest-side, transparent 64%, #000 68%, #000 95%, transparent 100%);
  filter: blur(7px);
  animation: orbit 52s linear infinite;
}

/* near side of the disc, flattened almost edge-on */
.disc--near {
  inset: -4%;
  background: conic-gradient(from 0deg,
      rgba(255,190,110,.00)   0deg,
      rgba(255,208,148,.88)  62deg,
      rgba(150,205,255,.66) 152deg,
      rgba(58,116,255,.34)  248deg,
      rgba(255,190,110,.00) 360deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 38%, #000 46%, #000 90%, transparent 100%);
          mask-image: radial-gradient(closest-side, transparent 38%, #000 46%, #000 90%, transparent 100%);
  transform: rotateX(77deg);
  filter: blur(11px);
  animation: orbit 34s linear infinite reverse;
}

.photon-ring {
  inset: 33%;
  box-shadow:
      0 0  2px 1px  rgba(222,240,255,.92),
      0 0 24px 5px  rgba(96,182,255,.55),
      0 0 68px 16px rgba(42,110,255,.28);
}

.event-horizon {
  inset: 34%;
  background: #000106;
  box-shadow: 0 0 46px 26px #000106;
}

@keyframes orbit { to { transform: rotate(360deg); } }
.disc--near { animation-name: orbit-tilted; }
@keyframes orbit-tilted {
  from { transform: rotateX(77deg) rotate(0deg); }
  to   { transform: rotateX(77deg) rotate(360deg); }
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 82% at 50% 34%, transparent 40%, rgba(1,4,14,.72) 100%);
}

/* ==========================================================================
   LIQUID GLASS
   ========================================================================== */
.glass {
  position: relative;
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--glass-lift);
  isolation: isolate;
}

/* the specular highlight that makes it read as a lens rather than a panel */
.glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(158deg,
      rgba(255,255,255,.20) 0%,
      rgba(255,255,255,.05) 18%,
      transparent 42%);
  pointer-events: none;
  z-index: -1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(9, 21, 52, .90); }
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: clamp(.7rem, 2vw, 1.1rem) var(--gutter) 0;
}

.topbar__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: .62rem .72rem .62rem 1.25rem;
  border-radius: 999px;
  display: flex; align-items: center; gap: 1rem;
}

.wordmark { display: flex; align-items: baseline; gap: .6rem; color: var(--ice); }
.wordmark:hover { text-decoration: none; }
.wordmark__name { font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; }
.wordmark__role {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .22em; color: var(--fog);
}

.nav { display: flex; gap: .35rem; margin-left: auto; }
.nav__link {
  color: var(--fog);
  padding: .42rem .9rem;
  border-radius: 999px;
  font-size: .95rem;
  transition: color .18s ease, background .18s ease;
}
.nav__link:hover { color: var(--ice); background: rgba(255,255,255,.07); text-decoration: none; }
.nav__link.is-current { color: var(--ice); background: rgba(255,255,255,.10); }

.account { display: flex; align-items: center; gap: .4rem; }
.inline-form { margin: 0; }

/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  padding: .55rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #4b7cff, var(--cobalt));
  border-color: rgba(160,200,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 8px 22px rgba(24,64,190,.45);
}
.btn--primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 30px rgba(24,64,190,.6); }

.btn--ghost {
  color: var(--ice);
  background: rgba(255,255,255,.08);
  border-color: rgba(180,210,255,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.btn--ghost:hover { background: rgba(255,255,255,.14); }

.btn--quiet {
  color: var(--fog);
  background: transparent;
  border-color: transparent;
}
.btn--quiet:hover { color: var(--ice); background: rgba(255,255,255,.07); }

.btn--danger { color: #ffc9c9; background: rgba(255,90,90,.12); border-color: rgba(255,120,120,.30); }
.btn--danger:hover { background: rgba(255,90,90,.22); }

.btn--sm { font-size: .84rem; padding: .34rem .85rem; }
.btn--wide { width: 100%; padding: .78rem 1.4rem; font-size: 1rem; }

.input--area {
  min-height: 8rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}
.input--area-sm { min-height: 4.5rem; }

code {
  font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: .86em;
  padding: .12em .38em;
  background: rgba(3, 10, 28, .6);
  border: 1px solid rgba(150,190,255,.16);
  border-radius: 6px;
  color: var(--halo);
}

.cheatsheet {
  margin: -.35rem 0 1.35rem;
  padding: .9rem 1.15rem;
  background: rgba(3, 10, 28, .38);
  border: 1px solid rgba(150,190,255,.13);
  border-radius: var(--radius-sm);
}
.cheatsheet__title {
  margin: 0 0 .5rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em;
  color: var(--fog);
}
.cheatsheet ul { margin: 0; padding-left: 1.1rem; }
.cheatsheet li { font-size: .88rem; color: var(--fog); margin-bottom: .3rem; }
.cheatsheet li:last-child { margin-bottom: 0; }

.jump { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 1.6rem; }
.jump__link {
  font-size: .82rem; font-weight: 600; color: var(--fog);
  padding: .34rem .9rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(150,190,255,.16);
  border-radius: 999px;
  transition: color .18s ease, background .18s ease;
}
.jump__link:hover { color: var(--ice); background: rgba(255,255,255,.12); text-decoration: none; }

.field { display: block; margin-bottom: 1.05rem; }
.field__label {
  display: block; margin-bottom: .42rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em;
  color: var(--fog);
}
.field__hint { margin: .45rem 0 0; font-size: .85rem; color: var(--fog); }

.input {
  width: 100%;
  font-family: var(--sans); font-size: 1rem; color: var(--ice);
  padding: .8rem 1rem;
  background: rgba(3, 10, 28, .55);
  border: 1px solid rgba(150,190,255,.20);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.45);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder { color: rgba(142,163,210,.6); }
.input:focus {
  outline: none;
  border-color: rgba(116,210,255,.65);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.45), 0 0 0 3px rgba(47,98,255,.28);
}

/* ==========================================================================
   PAGE STRUCTURE
   ========================================================================== */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 720px; }

.hero { padding: clamp(4rem, 14vh, 9rem) 0 clamp(2.5rem, 7vh, 4.5rem); }

.eyebrow {
  margin: 0 0 1rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .26em;
  color: var(--halo);
}

.display {
  margin: 0 0 1.1rem;
  font-size: clamp(2.5rem, 7.5vw, 4.6rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -.025em;
}
.display strong { font-weight: 700; }

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, .98rem + .5vw, 1.3rem);
  color: var(--fog);
  line-height: 1.65;
}

.section { padding: clamp(2rem, 6vh, 3.5rem) 0; }

.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.section__title {
  margin: 0;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2.05rem);
  font-weight: 600; letter-spacing: -.015em;
}
.section__count {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em;
  color: var(--fog);
}

/* ==========================================================================
   PUBLICATIONS
   ========================================================================== */
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.05rem; }

.pub {
  padding: clamp(1.3rem, 3vw, 1.9rem);
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1.6rem;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.pub:hover {
  transform: translateY(-3px);
  border-color: rgba(180,220,255,.30);
  box-shadow: var(--glass-lift), 0 0 40px rgba(47,98,255,.22);
}

/* the year is the structural marker — publications sort by it, so it carries
   real information rather than decorating the list */
.pub__year {
  font-size: 1.5rem; font-weight: 300; letter-spacing: -.01em;
  color: var(--halo);
  padding-top: .1rem;
  border-right: 1px solid rgba(150,190,255,.16);
  padding-right: 1rem;
  font-variant-numeric: tabular-nums;
}

.pub__title { margin: 0 0 .5rem; font-size: 1.16rem; font-weight: 600; line-height: 1.4; }
.pub__title a { color: var(--ice); }
.pub__title a:hover { color: var(--halo); }

.pub__authors { margin: 0 0 .45rem; font-size: .95rem; color: var(--ice); opacity: .8; }
.pub__source  { margin: 0 0 .8rem; font-size: .92rem; color: var(--fog); font-style: italic; }

.pub__abstract {
  margin: .2rem 0 .9rem;
  font-size: .95rem; color: var(--fog); line-height: 1.65;
  white-space: pre-line;   /* keeps the paragraph breaks CrossRef sends */
}
.pub__abstract[hidden] { display: none; }

.pub__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.tag {
  display: inline-block;
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em;
  padding: .3rem .7rem;
  color: var(--fog);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(150,190,255,.16);
  border-radius: 999px;
}

.doi-chip {
  font-size: .82rem; color: var(--halo);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.disclose {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--fog);
}
.disclose:hover { color: var(--halo); }

/* ==========================================================================
   EMPTY STATE / MESSAGES
   ========================================================================== */
.empty { padding: clamp(2rem, 6vw, 3.4rem); text-align: center; }
.empty__title { margin: 0 0 .5rem; font-size: 1.2rem; font-weight: 600; }
.empty__body  { margin: 0 auto; max-width: 42ch; color: var(--fog); }

.msg {
  padding: .85rem 1.15rem;
  margin: 0 0 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  border: 1px solid transparent;
}
.msg--error { color: #ffd2d2; background: rgba(255,72,72,.12); border-color: rgba(255,110,110,.32); }
.msg--ok    { color: #c6f6d9; background: rgba(48,220,130,.12); border-color: rgba(80,230,150,.30); }

/* ==========================================================================
   PROSE (About page)
   ========================================================================== */
.prose { padding: clamp(1.6rem, 4vw, 2.8rem); }
.prose h2 {
  margin: 2.2rem 0 .7rem;
  font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.05rem; color: rgba(234,241,255,.86); }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 1.05rem; padding-left: 1.2rem; color: rgba(234,241,255,.86); }
.prose li { margin-bottom: .4rem; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.facts li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(150,190,255,.12);
}
.facts li:last-child { border-bottom: 0; }
.facts dt, .facts .k {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .18em;
  color: var(--fog); padding-top: .28rem;
}

/* ==========================================================================
   AUTH / DASHBOARD
   ========================================================================== */
.auth { display: grid; place-items: center; min-height: 74vh; padding: 3rem 0; }
.auth__card { width: min(420px, 100%); padding: clamp(1.7rem, 5vw, 2.5rem); }
.auth__title { margin: 0 0 .35rem; font-size: 1.55rem; font-weight: 600; }
.auth__sub { margin: 0 0 1.8rem; color: var(--fog); font-size: .95rem; }

.panel[id], .section[id] { scroll-margin-top: 6.5rem; }

.panel { padding: clamp(1.4rem, 4vw, 2.1rem); margin-bottom: 1.4rem; }
.panel__title { margin: 0 0 .3rem; font-size: 1.2rem; font-weight: 600; }
.panel__sub { margin: 0 0 1.4rem; color: var(--fog); font-size: .93rem; }

.admin-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 1rem; align-items: center;
  padding: .95rem 0;
  border-bottom: 1px solid rgba(150,190,255,.12);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row__title { font-weight: 600; font-size: .98rem; margin: 0 0 .18rem; }
.admin-row__meta { margin: 0; font-size: .84rem; color: var(--fog); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) clamp(1.5rem, 4vh, 2.5rem); }
.footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.15rem clamp(1.2rem, 3vw, 2rem);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  border-radius: 999px;
}
.footer__copy { margin: 0; font-size: .92rem; color: var(--ice); }
.footer__meta { margin: 0; font-size: .74rem; color: var(--fog); letter-spacing: .04em; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 720px) {
  .topbar__inner { border-radius: var(--radius); flex-wrap: wrap; padding: .8rem 1rem; }
  .wordmark { width: 100%; }
  .nav { margin-left: 0; }
  .account { margin-left: auto; }
  .pub { grid-template-columns: 1fr; gap: .55rem; }
  .pub__year {
    border-right: 0; padding-right: 0;
    font-size: 1.05rem; font-weight: 700;
    letter-spacing: .1em;
  }
  .facts li { grid-template-columns: 1fr; gap: .15rem; }
  .footer__inner { border-radius: var(--radius); justify-content: flex-start; }
  .singularity { top: 6vh; width: 108vmin; opacity: .7; }
}

/* ==========================================================================
   MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .grid-warp { animation: none; }
}
