/* ============================================================
   Viha Tripathi - Portfolio
   Warm editorial theme. Fraunces serif + Inter.
   One file, no frameworks.
   ============================================================ */

:root {
  --bg: #fbf6f1;
  --bg-soft: #f7f0e8;
  --surface: #fffdf9;
  --surface-2: #f8f1e8;
  --border: #eadbca;
  --text: #433038;
  --muted: #8d6f78;
  --faint: #bda0a9;
  --accent: #c64b6e;
  --accent-soft: rgba(198, 75, 110, 0.08);
  --radius: 18px;
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
em { font-family: var(--font-serif); font-style: italic; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 28px; }
.section { padding: 110px 0; }

.section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 18px;
}

.section-lead {
  color: var(--muted);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 64px;
  font-size: 1.02rem;
}

.text-link {
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: color 0.2s ease;
  display: inline-block;
  margin-top: 6px;
}
.text-link:hover { color: var(--accent); }

/* ---------------- NAV ---------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(251, 246, 241, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 15px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.logo-dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-social { display: flex; align-items: center; gap: 14px; }
.nav-social a {
  color: var(--muted);
  display: inline-flex;
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-social a:hover { color: var(--accent); transform: translateY(-2px); }
.nav-social svg { width: 19px; height: 19px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------------- HERO ---------------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 28px 70px;
  position: relative;
}

.hero-inner { max-width: 760px; }

.hero-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 26px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(3.4rem, 11vw, 6.8rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.hero h1 em { color: var(--accent); }

.trace {
  width: min(320px, 70vw);
  height: 48px;
  margin: 30px auto 6px;
  display: block;
  overflow: visible;
}
.trace-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  animation: trace-draw 3.2s ease forwards, trace-pulse 3s ease-in-out 3.4s infinite;
  opacity: 0.9;
}
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
@keyframes trace-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.45; }
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  margin: 22px 0 38px;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 34px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pill-solid { background: var(--accent); color: #fff; }
.pill-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(198, 75, 110, 0.32); }
.pill-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.pill-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.pill-lg { padding: 16px 40px; font-size: 1.02rem; }

/* ---------------- ABOUT ---------------- */
.about-centered {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.about-photo {
  width: 160px;
  margin: 0 auto 30px;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 22px 22px;
  border: 1px solid var(--border);
  display: block;
}
.about-copy p { color: var(--muted); margin-bottom: 20px; font-size: 1.06rem; }
.about-personal { margin-top: 28px; margin-bottom: 0 !important; }
.about-personal em { color: var(--accent); font-size: 1.12rem; }

/* ---------------- PROJECTS ---------------- */
.project-list {
  max-width: 860px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.project {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 26px;
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.25s ease;
}
.project-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--faint);
  padding-top: 6px;
}
.project-main h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}
.project:hover .project-main h3 { color: var(--accent); }
.project-meta {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.project-main > p { color: var(--muted); font-size: 0.99rem; margin-bottom: 12px; max-width: 640px; }
.project-tags { color: var(--muted); font-size: 1rem; }
.project-tags em { color: var(--accent); }

.wip-tag {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 5px 14px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 10px;
  white-space: nowrap;
}

/* ---------------- EXPERIENCE ---------------- */
.timeline {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.timeline-item {
  position: relative;
  padding: 0 0 40px 40px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 26px;
  bottom: -6px;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: 0 2px 14px rgba(67, 48, 56, 0.05);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.timeline-card:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: 0 10px 28px rgba(198, 75, 110, 0.1); }
.timeline-date {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.timeline-card h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 8px 0 2px;
  letter-spacing: -0.01em;
}
.timeline-org { color: var(--muted); margin-bottom: 14px; }
.timeline-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.timeline-card li {
  color: var(--muted);
  font-size: 0.93rem;
  padding-left: 20px;
  position: relative;
}
.timeline-card li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.subsection-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  text-align: center;
  margin: 84px 0 40px;
}

.beyond-list {
  max-width: 640px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}
.beyond-row {
  padding: 26px 6px;
  border-bottom: 1px solid var(--border);
}
.beyond-role {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 1.8rem);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.beyond-where {
  display: block;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------------- CONTACT ---------------- */
.contact-inner { text-align: center; max-width: 640px; }
.contact-big {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 18px;
}
.contact-big em { color: var(--accent); }
.contact-inner .section-lead { margin-bottom: 36px; }
.contact-actions { margin-bottom: 30px; }
.contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}
.contact-phone { color: var(--faint); font-size: 0.92rem; }

/* ---------------- FOOTER ---------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.85rem;
}
.footer-inner a { color: var(--muted); transition: color 0.2s ease; }
.footer-inner a:hover { color: var(--accent); }

/* ---------------- REVEAL ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .trace-line { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 860px) {
  .section { padding: 84px 0; }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: 62px; right: 0; left: 0;
    flex-direction: column;
    background: rgba(251, 246, 241, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 26px;
    gap: 22px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-social { display: none; }
  .project { grid-template-columns: 1fr; gap: 8px; padding: 36px 0; }
  .project-num { padding-top: 0; }
}
