/* ==========================================================================
   Poorvi H C — portfolio stylesheet  ·  Iteration 2: "Warm Paper"
   Palette: warm cream + dusty rose + sage + warm gold
   Type:    Fraunces everywhere (display + headings) + DM Sans (body) + JetBrains Mono
   ========================================================================== */

:root {
  --ink: #241b14;
  --ink-soft: #5a4a3c;
  --paper: #faf7f2;
  --paper-warm: #f5f0e8;
  --rose: #b5546a;
  --rose-soft: #f7ece9;
  --sage: #4a7c6f;
  --sage-soft: #eaf2ef;
  --gold: #c08b30;
  --gold-soft: #fdf4e3;
  --mauve: #7a5c78;
  --line: #e6ddd0;
  --maxw: 860px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-hover: 0.2s;
  --dur-reveal: 0.55s;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: 'DM Sans', Georgia, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- links ---------- */
a {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rose) 30%, transparent);
  text-underline-offset: 3px;
  transition: color var(--dur-hover) ease, text-decoration-color var(--dur-hover) ease;
}
a:hover, a:focus {
  color: var(--sage);
  text-decoration-color: var(--sage);
}
a:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
section { padding: 56px 0 8px; }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Hero — warm paper, left-dominant layout
   ========================================================================== */
.hero {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
}

.hero .wrap {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 80px;
}

.hero-text { flex: 1 1 64%; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 20px;
  max-width: 52ch;
}

.name {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 28px;
}
.name.name-serif {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 700;
}
.name.name-sans {
  font-family: 'Outfit', Verdana, sans-serif;
  font-weight: 700;
}

.hero p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  max-width: 52ch;
  font-size: 16px;
}
.hero a { color: var(--sage); }
.hero a:hover, .hero a:focus { color: var(--rose); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 18px;
  text-decoration: none;
  transition: background var(--dur-hover) ease, border-color var(--dur-hover) ease,
              color var(--dur-hover) ease;
}
.links a:hover, .links a:focus {
  background: var(--rose-soft);
  border-color: var(--rose);
  color: var(--rose);
}

.hero-photo {
  flex: 0 0 auto;
  position: relative;
}

.hero-photo::before {
  content: "";
  position: absolute;
  top: 14px;
  right: -14px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--rose);
  border-radius: 14px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-photo img {
  display: block;
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 4px 8px 28px rgba(36, 27, 20, .13);
}

/* hide old toggles / SVG */
.hero-net { display: none; }
.type-preview { display: none; }

/* ==========================================================================
   Section headings — Fraunces serif, warm
   ========================================================================== */
h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}

.rule {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--rose);
  border-radius: 2px;
  margin-bottom: 32px;
}
.rule i { display: none; }

h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}

/* ==========================================================================
   Publications
   ========================================================================== */
.pub {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.pub:first-of-type { border-top: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }

.pub-thumb {
  flex: 0 0 200px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-warm);
  border: 1px solid var(--line);
}
.pub-thumb img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: contain;
  padding: 8px;
}

.pub-body { flex: 1; }

.papertitle {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  text-decoration: none;
}
a .papertitle { text-decoration: none; }
a:hover .papertitle, a:focus .papertitle { color: var(--rose); }

.authors { margin: 10px 0 6px; font-size: 14.5px; }
.authors strong { color: var(--ink); font-weight: 600; }

.badge {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--sage);
  background: var(--sage-soft);
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 8px;
}

.venue { font-style: italic; font-size: 14.5px; color: var(--ink-soft); }

.pub-links {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  margin: 8px 0 12px;
}
.pub-links a { color: var(--sage); text-decoration: none; }
.pub-links a:hover { color: var(--rose); }
.pub-links a + a::before { content: " · "; color: var(--line); }

.pub p.abstract { margin: 10px 0 0; font-size: 14.5px; line-height: 1.68; }

/* ==========================================================================
   Experience timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.job {
  position: relative;
  padding-bottom: 44px;
}
.job:last-child { padding-bottom: 8px; }

.job::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--rose-soft);
  border: 2px solid var(--rose);
}

.job.is-visible::before {
  animation: node-pulse 0.5s var(--ease-out) both;
}
@keyframes node-pulse {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.dates {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.6;
  white-space: nowrap;
}

.role {
  font-weight: 400;
  font-size: 15px;
  color: var(--sage);
  margin: 4px 0 12px;
  font-style: italic;
}

.job p { margin: 0 0 12px; font-size: 15px; }
.job p em { color: var(--gold); font-style: italic; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--mauve);
  background: color-mix(in srgb, var(--mauve) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--mauve) 20%, transparent);
  border-radius: 4px;
  padding: 2px 10px;
}

/* ==========================================================================
   Projects grid
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-warm);
  padding: 24px 26px 22px;
  transition: transform var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(36, 27, 20, .08);
  background: #fff;
}
.card a { text-decoration: none; }
.card .papertitle {
  font-size: 16.5px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
}
.card a:hover .papertitle { color: var(--rose); }

.stack {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--gold);
  margin: 8px 0 2px;
}
.card p { margin: 10px 0 0; font-size: 14.5px; }

/* ==========================================================================
   Teaching & responsibilities
   ========================================================================== */
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex;
  gap: 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.term {
  flex: 0 0 120px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--rose);
  padding-top: 3px;
  opacity: 0.85;
}
.row:nth-child(even) .term { color: var(--sage); }
.row div:last-child { flex: 1; font-size: 15px; }
.row em { color: var(--ink); font-style: normal; font-weight: 600; }

/* ==========================================================================
   Contact form
   ========================================================================== */
.contact-intro {
  margin: 0 0 32px;
  font-size: 16px;
  max-width: 48ch;
  color: var(--ink-soft);
}

.contact-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.65;
}

.field input,
.field textarea {
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
  resize: none;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 12%, transparent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.4;
}

.send-btn {
  align-self: flex-start;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--rose);
  border: none;
  border-radius: 6px;
  padding: 10px 26px;
  cursor: pointer;
  transition: background var(--dur-hover) ease, transform var(--dur-hover) ease;
}

.send-btn:hover {
  background: color-mix(in srgb, var(--rose) 82%, black);
  transform: translateY(-1px);
}

.form-result {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin: -8px 0 0;
  min-height: 1.4em;
}
.form-result.is-success { color: var(--sage); }
.form-result.is-error   { color: var(--rose); }

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  margin-top: 80px;
  padding: 28px 0;
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  text-align: center;
  opacity: 0.8;
}
footer a { color: var(--rose); text-decoration: none; }
footer a:hover { color: var(--sage); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .hero .wrap {
    flex-direction: column-reverse;
    text-align: center;
    gap: 28px;
    padding-top: 48px;
    padding-bottom: 56px;
  }
  .hero p { margin-left: auto; margin-right: auto; }
  .links { justify-content: center; }
  .hero-photo::before { display: none; }
  .hero-photo img { width: 148px; height: 148px; border-radius: 50%; }
  .form-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .pub { flex-direction: column; gap: 16px; }
  .pub-thumb { flex-basis: auto; width: 100%; max-width: 220px; }
  .row { flex-direction: column; gap: 4px; }
  .term { flex-basis: auto; }
}

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