/* ==========================================================================
   Aman Kumar — site.css
   Direction: "Graphite & Amber"

   An editorial academic surface. Cool graphite paper, a serif voice for
   names and headings, hairline rules instead of cards and glows, and one
   warm amber signature — the colour of starlight — held to well under 10%
   of the surface.

   Not: neon, glassy, gradient text, pill CTAs, hover-lift cards.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — cool graphite, tinted so they read as authored, not empty */
  --bg:            #111213;
  --bg-elev:       #16171a;
  --surface:       #191a1c;

  /* Ink */
  --text:          #dcdcda;
  --text-strong:   #f4f4f2;
  --muted:         #a2a4a1;
  --faint:         #7d8083;

  /* Rules — this system draws edges with hairlines, not shadows */
  --rule:          rgba(255, 255, 255, 0.10);
  --rule-soft:     rgba(255, 255, 255, 0.055);

  /* Signature */
  --accent:        #d8a15c;
  --accent-bright: #e8b979;
  --accent-dim:    rgba(216, 161, 92, 0.32);
  --accent-wash:   rgba(216, 161, 92, 0.10);
  --focus:         #e8b979;

  /* Type */
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:  "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: clamp(2.6rem, 7vw, 4.6rem);
  --fs-h2:      clamp(1.5rem, 2.6vw, 2rem);
  --fs-h3:      clamp(1.05rem, 1.6vw, 1.1875rem);
  --fs-body:    1.0625rem;   /* 17px — light type reads thinner, so it sits above 16 */
  --fs-small:   0.9375rem;
  --fs-label:   0.75rem;

  --measure: 68ch;
  --shell:   1080px;
  --gutter:  clamp(20px, 5vw, 56px);

  /* Space — every value is a multiple of 1, 4, or 9 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 36px;
  --s-6: 56px;
  --s-7: 88px;

  --section-y: clamp(56px, 8vw, 88px);

  /* Edges — consistent, small, never pill-shaped */
  --r-sm: 4px;
  --r:    8px;

  /* Motion — one decelerating curve, settled durations */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms;
  --dur:      220ms;
  --dur-slow: 420ms;

  --nav-h: 64px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  letter-spacing: 0.004em;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--text-strong);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

::selection {
  background: var(--accent-dim);
  color: var(--text-strong);
}

/* Scrollbar, so the chrome matches the paper */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--rule);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. Links & focus
   -------------------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur) var(--ease),
              text-decoration-color var(--dur) var(--ease);
}

a:hover {
  color: var(--accent-bright);
  text-decoration-color: currentColor;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Visible only to keyboard users, on the first Tab press */
.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 2000;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* --------------------------------------------------------------------------
   4. Site navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  background: rgba(17, 18, 19, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule-soft);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav ul::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}

.site-nav a:hover {
  color: var(--text-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. Masthead
   -------------------------------------------------------------------------- */

.masthead {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(58vh, 520px);
  padding: calc(var(--nav-h) + var(--s-7)) var(--gutter) var(--s-7);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(216, 161, 92, 0.06), transparent 62%),
    var(--bg);
}

.masthead__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
}

.masthead h1 {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.masthead h1::before {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-bottom: var(--s-4);
  background: var(--accent);
}

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   6. Sections
   -------------------------------------------------------------------------- */

.section {
  padding: var(--section-y) var(--gutter);
  border-top: 1px solid var(--rule-soft);
}

.section--elev {
  background: var(--bg-elev);
}

.section--close {
  border-top-color: var(--rule);
}

.section__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
}

/* Heading plus an extending hairline rule — the editorial signature */
.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.section__head::after {
  content: "";
  flex: 1;
  height: 1px;
  min-width: var(--s-4);
  background: var(--rule);
}

.section__head h2 {
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: var(--s-4);
}

/* --------------------------------------------------------------------------
   7. Register (notice board)
   Dated entries on a baseline grid, not cards on a scrolling rail.
   -------------------------------------------------------------------------- */

.register {
  display: grid;
}

.register__row {
  display: grid;
  grid-template-columns: minmax(112px, 148px) minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--rule-soft);
  transition: border-color var(--dur) var(--ease);
}

.register__row:first-child {
  padding-top: 0;
  border-top-color: transparent;
}

.register__row:hover {
  border-top-color: var(--rule);
}

.register__date {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color var(--dur) var(--ease);
}

.register__text {
  font-size: var(--fs-body);
  color: var(--text);
  transition: color var(--dur) var(--ease);
}

.register__row:hover .register__text {
  color: var(--text-strong);
}

/* The most recent entry carries the only "live" mark on the page */
.register__row:first-child .register__date {
  color: var(--accent);
}

.register__row:first-child .register__date::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--s-2);
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* --------------------------------------------------------------------------
   8. About
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-6);
  align-items: start;
}

.about-grid .prose p {
  text-align: left;   /* ragged right beats justified rivers on dark */
}

.portrait {
  width: 200px;
  border-radius: var(--r);
  overflow: hidden;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

/* --------------------------------------------------------------------------
   9. Actions
   -------------------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.btn::after {
  content: "\2192";
  transition: transform var(--dur) var(--ease);
}

.btn:hover {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent-bright);
}

.btn:hover::after {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   10. Contact
   -------------------------------------------------------------------------- */

.contact-rows {
  display: grid;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--rule-soft);
}

.contact-row:first-child {
  padding-top: 0;
  border-top-color: transparent;
}

.contact-row__label {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact-row__value {
  color: var(--text);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
}

.social li {
  display: flex;
  align-items: center;
}

.social li + li::before {
  content: "\00b7";
  margin-right: var(--s-4);
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   11. Page head (inner pages)
   -------------------------------------------------------------------------- */

.page-head {
  padding: calc(var(--nav-h) + var(--s-6)) var(--gutter) var(--s-6);
  border-bottom: 1px solid var(--rule-soft);
}

.page-head__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
}

.page-head h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.page-head h1::before {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-bottom: var(--s-4);
  background: var(--accent);
}

.page-body {
  padding: var(--section-y) var(--gutter);
}

.page-body__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
}

/* Vertical rhythm between the top-level blocks of an inner page */
.page-body__inner > * + * {
  margin-top: var(--s-4);
}

/* --------------------------------------------------------------------------
   12. Index lists — papers and projects
   Hairline-separated rows. No cards, no glow, no lift.
   -------------------------------------------------------------------------- */

.index-list {
  display: grid;
}

.paper,
.project {
  padding: var(--s-5) 0;
  border-top: 1px solid var(--rule-soft);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}

.paper:first-child,
.project:first-child {
  padding-top: 0;
  border-top-color: transparent;
}

.paper:hover,
.project:hover {
  border-top-color: var(--rule);
}

.paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s-4);
}

.project {
  display: grid;
  gap: var(--s-2);
}

.project__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.paper__title,
.project__name {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  transition: color var(--dur) var(--ease);
}

.paper__title {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.35;
}

.project__name {
  font-size: var(--fs-h3);
  line-height: 1.3;
}

.paper__cue,
.project__cue {
  flex: none;
  font-size: var(--fs-small);
  line-height: 1;
  color: var(--faint);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.paper:hover .paper__title,
.project:hover .project__name,
.paper:hover .paper__cue,
.project:hover .project__cue {
  color: var(--accent);
}

.paper:hover .paper__cue,
.project:hover .project__cue {
  transform: translate(2px, -2px);
}

.project__desc {
  max-width: var(--measure);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   12b. Publication rows — grouped by theme
   -------------------------------------------------------------------------- */

.pub-group + .pub-group {
  margin-top: var(--s-6);
}

.pub-group__head {
  margin-bottom: var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pub-list {
  display: grid;
}

.pub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2) var(--s-5);
  align-items: start;
  padding: var(--s-4) 0;
  border-top: 1px solid var(--rule-soft);
}

.pub:first-child {
  padding-top: 0;
  border-top-color: transparent;
}

/* Year and topic, right-aligned like an index */
.pub__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-1);
  text-align: right;
}

.pub__year {
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.pub__tag {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.pub__title {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.4;
}

.pub__title a {
  color: var(--text-strong);
  text-decoration-color: transparent;
}

.pub__title a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.pub__authors {
  margin-top: var(--s-1);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--muted);
}

.pub__authors strong {
  font-weight: 600;
  color: var(--text-strong);
}

.pub__venue {
  margin-top: var(--s-1);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--faint);
}

.pub-more {
  margin-top: var(--s-5);
  font-size: var(--fs-small);
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   13. Tags (research interests) & page footer
   -------------------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tags li {
  padding: 6px var(--s-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tags li:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.page-footer {
  padding: var(--s-5) var(--gutter);
  border-top: 1px solid var(--rule);
  background: var(--bg);
}

.page-footer__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  font-size: var(--fs-small);
  color: var(--faint);
}

/* Heading kept for structure without duplicating the visible page title */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}

/* --------------------------------------------------------------------------
   14. Motion
   -------------------------------------------------------------------------- */

:root {
  --d: 0ms;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-slow) var(--ease) var(--d),
                transform var(--dur-slow) var(--ease) var(--d);
  }

  .register__row:first-child .register__date::before {
    animation: beacon 2.6s var(--ease) infinite;
  }
}

@keyframes beacon {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-wash);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(216, 161, 92, 0.03);
  }
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }

  .portrait {
    width: 180px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    padding: 0 var(--s-3);
  }

  .site-nav ul {
    gap: var(--s-4);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }

  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }

  .masthead {
    min-height: min(48vh, 420px);
    padding-top: calc(var(--nav-h) + var(--s-6));
  }
}

@media (max-width: 560px) {
  .register__row,
  .contact-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-1);
  }

  .pub {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
  }

  .pub__meta {
    flex-direction: row;
    align-items: baseline;
    gap: var(--s-3);
    text-align: left;
  }

  .btn {
    width: 100%;
    justify-content: space-between;
  }

  .social li + li::before {
    content: none;
  }
}

/* --------------------------------------------------------------------------
   16. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
