/* ============================================================
   Archana Yadav — personal research site
   Modern, light, compact. Hand-editable, no build step.
   ============================================================ */

:root {
  --bg:        #FAFAF8;   /* Soft White — background */
  --alt:       #F0EFEC;   /* Warm Gray — alternate background */
  --surface:   #F7F7F5;   /* Off White — cards / panels */
  --text:      #111111;   /* Rich Black — primary text */
  --muted:     #333333;   /* Charcoal — secondary text */
  --faint:     #666666;   /* Slate Gray — muted text */
  --line:      #D8D8D8;   /* Light Gray — borders */
  --hover:     #B8B8B8;   /* Medium Gray — hover states */
  --silver:    #C4C4C4;   /* Silver Gray — accent light */
  --accent:    #1A1A1A;   /* Near Black — accent dark */
  --accent-2:  #F0EFEC;   /* subtle neutral hover tint */
  --q-bg:      #F5F4F2;   /* fundamental-question box (slightly lighter than --alt) */
  --maxw:      1100px;
  --rail:      116px;   /* journal-style year column */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

/* Dark theme (neutral grayscale) */
html[data-theme="dark"] {
  --bg:       #121212;
  --alt:      #1c1c1c;
  --surface:  #1a1a1a;
  --text:     #FAFAF8;
  --muted:    #C4C4C4;
  --faint:    #8a8a8a;
  --line:     rgba(255, 255, 255, .14);
  --hover:    #6a6a6a;
  --silver:   #6a6a6a;
  --accent:   #FAFAF8;
  --accent-2: rgba(255, 255, 255, .08);
  --q-bg:     #242424;   /* slightly lighter than --alt in dark */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; font-size: 92.5%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--silver);
  text-underline-offset: 2px;
  transition: text-decoration-color .15s ease;
}
a:hover { text-decoration-color: currentColor; }

/* Keep icon nav links and the skip link underline-free */
.links a, .skip-link { text-decoration: none; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--text); color: #fff; padding: .5rem .9rem; border-radius: 6px; z-index: 50;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Refinements ---------- */

/* Barely-there paper grain for warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body::before { opacity: .055; }

/* Custom selection */
::selection { background: rgba(17, 17, 17, .12); }
html[data-theme="dark"] ::selection { background: rgba(250, 250, 248, .22); }

/* Refined focus rings (keyboard only) */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scroll-reveal (only when JS is present, so no-JS still shows content) */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 3.5vw, 1.75rem);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 2.5rem; }

.card { display: flex; flex-direction: column; }

.avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--accent-2);
  display: grid; place-items: center;
}
.avatar::after {
  content: "Add\00000aprofile.jpg";
  white-space: pre;
  text-align: center;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--faint);
}
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.15rem;
  line-height: 1.04;
  letter-spacing: 0.005em;
  margin: 1.15rem 0 .5rem;
}
.role {
  margin: 0 0 .45rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.3;
}
/* Proof strip — quick-signal pills under the name */
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .15rem 0 .85rem;
}
.proof span {
  font-size: .7rem;
  letter-spacing: .01em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .22rem .6rem;
  white-space: nowrap;
}

.tagline {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: .92rem;
  color: var(--faint);
  letter-spacing: .005em;
}

.links { display: flex; flex-direction: column; gap: .15rem; }
.links a {
  display: flex; align-items: center; gap: .6rem;
  padding: .42rem .5rem;
  margin-left: -.5rem;
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.links a:hover { background: var(--accent-2); color: var(--accent); text-decoration: none; }
.links svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.links a:hover svg { color: var(--accent); }

/* Theme toggle — fixed icon button, top-right */
.theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 60;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease;
}
.theme-toggle:hover { background: var(--accent-2); }
.theme-toggle .theme-label { display: none; }
.theme-toggle svg { width: 19px; height: 19px; flex: none; color: var(--text); }
html[data-theme="dark"] .ic-moon { display: none; }
html:not([data-theme="dark"]) .ic-sun { display: none; }

/* ---------- Main ---------- */
.main { min-width: 0; }

.intro p {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  color: var(--text);
}
.intro p + p { color: var(--muted); }
.intro strong { font-weight: 600; }
.intro em { font-style: italic; color: var(--text); }

.block { margin-top: 3.4rem; }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.4vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 1.5rem;
}

/* ---------- Lists (shared reset) ---------- */
.pub-list, .exp-list, .proj-list { list-style: none; margin: 0; padding: 0; }

/* Research — full-width figure + journal-style year rail for the text */
.pub { padding: 0 0 2.2rem; }
.pub:last-child { padding-bottom: 0; }
.pub-text {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 1.4rem;
}
.rail-year {
  margin: .1rem 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--faint);
  font-feature-settings: "onum" 1;
  letter-spacing: .01em;
}

/* Paper hero figure — show the full figure, no cropping */
.pub-fig {
  margin: 0 0 1rem;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.pub-body .pub-fig { margin-top: .8rem; }
.pub-fig img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
.pub-fig:hover img { transform: scale(1.035); }
.pub-fig .fig-doc { padding: 14px 16px; }
/* Height-capped figure: keep a tall/near-square diagram short, in sync with the wide strips */
.pub-fig--cap { text-align: center; }
.pub-fig--cap img { width: auto; max-width: 100%; max-height: 250px; margin: 0 auto; }
.pub h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 .25rem;
}
.pub .meta {
  margin: 0 0 .4rem;
  font-size: .82rem;
  color: var(--faint);
  font-weight: 500;
  letter-spacing: .01em;
}
.pub .desc { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.6; }
.pub-q {
  margin: .25rem 0 .7rem;
  padding: .65rem .85rem;
  background: var(--q-bg);
  border-radius: 8px;
  color: var(--muted);
  font-style: italic;
  font-size: .98rem;
  line-height: 1.55;
}
.tldr {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
  margin-right: .35rem;
}
.pub-links { margin: .75rem 0 0; display: flex; gap: .55rem; flex-wrap: wrap; }
.pub-links a {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .72rem;
  background: var(--alt);
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.pub-links a::after {
  content: "\2197";           /* ↗ */
  font-size: .92em;
  color: var(--faint);
  transition: color .18s ease, transform .18s ease;
}
.pub-links a:hover { background: var(--accent); color: var(--bg); }
.pub-links a:hover::after { color: var(--bg); transform: translate(1px, -1px); }

/* Experience & Education — same year rail */
.exp {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 1.4rem;
  padding: 0 0 1.8rem;
}
.exp:last-child { padding-bottom: 0; }
.exp .when {
  margin: .55rem 0 0;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--faint);
  font-weight: 400;
  font-feature-settings: "onum" 1;
  letter-spacing: .01em;
}
.exp .what h3 {
  margin: 0 0 .3rem;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
}
.exp .what h3 .adv { font-weight: 400; font-size: .9rem; color: var(--faint); }
/* Advisor names sized to match the heading; only the "Advisor:" label stays small */
.exp .what h3 .adv a { font-size: 1.12rem; }
.exp .what p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Org logo badges */
.exp-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .35rem; }
.exp-head h3 { margin: 0; }
.orglogo {
  flex: none;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
  padding: 5px;
}
.orglogo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.orglogo.mono {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Projects */
.proj-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.proj {
  background: var(--surface);
  padding: 1.2rem 1.3rem;
  border-radius: 12px;
  transition: background .2s ease;
}
.proj:hover { background: var(--alt); }
.proj h3 {
  margin: 0 0 .45rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}
.proj p { margin: 0; color: var(--muted); font-size: .92rem; }
.proj .stack {
  margin-top: .7rem;
  font-size: .72rem;
  color: var(--faint);
  letter-spacing: .01em;
}

/* Footer */
.footer {
  margin-top: 3.5rem;
  font-size: .82rem;
  color: var(--faint);
}
.footer a { color: var(--muted); }

/* ============================================================
   Section scroll-spy dots
   ============================================================ */
.scrollspy {
  position: fixed;
  right: clamp(.55rem, 1.6vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  align-items: center;
}
.scrollspy a {
  position: relative;
  display: block;
  padding: 5px;            /* generous hit area around the dot */
  line-height: 0;
  text-decoration: none;
}
.ss-dot {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--silver);
  transition: background .25s ease, transform .25s ease;
}
.scrollspy a:hover .ss-dot { background: var(--muted); transform: scale(1.25); }
.scrollspy a.is-active .ss-dot { background: var(--accent); transform: scale(1.55); }
/* hover label */
.scrollspy a::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  white-space: nowrap;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--faint);
  background: var(--surface);
  padding: .18rem .5rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.scrollspy a:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .ss-dot, .scrollspy a::after { transition: none; }
}
@media (max-width: 720px) {
  .scrollspy { display: none; }
}

/* ============================================================
   Decorative: flower + circuit ornament & drifting petals
   ============================================================ */
.ornament {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  color: var(--silver);
  overflow: hidden;
}
.ornament svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ornament--tr { top: -78px; right: -78px; width: 360px; height: 360px; opacity: .15; }
.ornament--bl { bottom: -90px; left: -96px; width: 300px; height: 300px; opacity: .09; }

.petal {
  fill: none;
  stroke: var(--silver);
  stroke-width: 1.3;
}
.core { fill: currentColor; }
.wire { stroke: currentColor; stroke-width: 1; fill: none; stroke-dasharray: 4 6; opacity: .55;
        animation: wire-flow 7s linear infinite; }
.tip  { fill: currentColor; transform-box: fill-box; transform-origin: center;
        animation: tip-pulse 3.6s ease-in-out infinite; }

.bloom  { transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
.bloom--slow { animation-duration: 130s; animation-direction: reverse; }
.petals { transform-box: fill-box; transform-origin: center; animation: breathe 7s ease-in-out infinite; }

@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes breathe   { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes wire-flow { to { stroke-dashoffset: -40; } }
@keyframes tip-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Drifting petals */
.petal-field { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.drift {
  position: absolute;
  top: -5vh;
  width: 13px; height: 13px;
  opacity: .15;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7 8 7 16 12 22 17 16 17 8 12 2Z' fill='%23C4C4C4'/%3E%3C/svg%3E");
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes fall {
  0%   { transform: translate(0, -6vh) rotate(0deg);     opacity: 0; }
  12%  { opacity: .17; }
  50%  { transform: translate(22px, 50vh) rotate(160deg); }
  88%  { opacity: .17; }
  100% { transform: translate(-10px, 106vh) rotate(320deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bloom, .petals, .wire, .tip { animation: none !important; }
  .petal-field { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { position: static; }
  .card { flex-direction: column; align-items: flex-start; }
  .avatar { width: 110px; height: 110px; }
  .name { margin-top: .9rem; }
  .links { flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .links a span { display: none; }
  .links a { padding: .55rem; margin-left: 0; }
  .exp, .pub-text { grid-template-columns: 1fr; gap: .3rem; }
  .exp .when { order: -1; margin-top: 0; }
  .rail-year { margin-top: 0; }
  .ornament--tr { width: 230px; height: 230px; opacity: .1; top: -50px; right: -60px; }
  .ornament--bl { display: none; }
}
