/* =========================================================
   Dr. Tripti Juyal Semwal — Portfolio
   Palette: cream #F3ECE0 · sand #D9C3A5 · orange #F26A1B
   Type: Manrope
   ========================================================= */
:root {
  --cream: #F3ECE0;
  --cream-2: #EBE1D0;
  --sand: #D9C3A5;
  --sand-2: #BFA582;
  --orange: #F26A1B;
  --orange-d: #D4560C;
  --ink: #231912;
  --ink-2: #4E3D30;
  --muted: #85705E;
  --paper: #FBF7F0;
  --rule: rgba(35, 25, 18, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Manrope", sans-serif;
  --pad: clamp(56px, 7vw, 96px);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
::selection { background: var(--orange); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin-bottom: 1rem; }

.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 1100; }
.scroll-progress span { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- type ---------- */
.label {
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 1.25rem; display: flex; align-items: center; gap: .75rem;
}
.label::after { content: ''; height: 1px; width: 48px; background: currentColor; opacity: .5; }
.label.light { color: var(--sand); }
.intro {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.45; font-weight: 600;
  letter-spacing: -.02em; color: var(--ink); margin-bottom: 1.5rem;
}
.body-text { color: var(--ink-2); }
.side-title { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.3; color: var(--ink); }

/* ---------- buttons ---------- */
.btn-brand, .btn-line {
  --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .75rem;
  border-radius: 8px; font-weight: 600; font-size: .92rem;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn-brand { background: var(--orange); color: #fff; border: 1.5px solid var(--orange); }
.btn-brand:hover, .btn-brand:focus-visible { background: var(--orange-d); border-color: var(--orange-d); color: #fff; transform: translateY(-2px); }
.btn-line { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }

/* ---------- nav ---------- */
.site-nav { padding: .9rem 0; transition: padding .35s var(--ease), background .35s, box-shadow .35s; z-index: 1050; }
.site-nav.scrolled {
  padding: .5rem 0; background: rgba(243,236,224,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--cream); font-size: .78rem; font-weight: 800; letter-spacing: .03em;
}
.brand-text { font-size: .98rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.site-nav .nav-link { font-size: .88rem; font-weight: 500; color: var(--ink-2); padding: .45rem .9rem !important; position: relative; }
.site-nav .nav-link::after {
  content: ''; position: absolute; left: .9rem; right: .9rem; bottom: .2rem; height: 1.5px;
  background: var(--orange); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--ink); }
.site-nav .nav-link:hover::after, .site-nav .nav-link.active::after { transform: scaleX(1); transform-origin: left; }
.site-nav .nav-cta { border: 1.5px solid var(--ink); border-radius: 8px; margin-left: .5rem; padding: .4rem 1rem !important; color: var(--ink) !important; }
.site-nav .nav-cta::after { display: none; }
.site-nav .nav-cta:hover { background: var(--ink); color: var(--cream) !important; }

.nav-toggle { border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); display: grid; place-content: center; gap: 6px; padding: 0; }
.nav-toggle:focus { box-shadow: 0 0 0 3px rgba(242,106,27,.35); }
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--cream); transition: transform .35s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 991.98px) {
  .site-nav .navbar-collapse { margin-top: .6rem; background: var(--paper); border-radius: 12px; padding: .5rem; box-shadow: 0 20px 40px -20px rgba(35,25,18,.35); }
  .site-nav .nav-link { padding: .75rem 1rem !important; font-size: 1rem; }
  .site-nav .nav-link::after { display: none; }
  .site-nav .nav-cta { margin: .4rem 0 0; text-align: center; }
  .site-nav:has(.navbar-collapse.show) { background: rgba(243,236,224,.95); }
}

/* ---------- 3D scene + reveal (replays every pass) ---------- */
.scene { perspective: 1400px; perspective-origin: 50% 30%; }
.scene-inner { transform-style: preserve-3d; will-change: transform, opacity; }

.reveal { --d: 0s; transition: opacity .9s var(--ease) var(--d), transform 1s var(--ease) var(--d); }
.reveal[data-anim="up"]    { opacity: 0; transform: translate3d(0, 32px, 0); }
.reveal[data-anim="left"]  { opacity: 0; transform: perspective(1000px) translate3d(-40px, 0, -60px) rotateY(10deg); }
.reveal[data-anim="right"] { opacity: 0; transform: perspective(1000px) translate3d(40px, 0, -60px) rotateY(-10deg); }
.reveal[data-anim="zoom"]  { opacity: 0; transform: perspective(1000px) translate3d(0, 30px, -120px) rotateX(8deg); }
.reveal[data-anim="flip"]  { opacity: 0; transform: perspective(900px) translate3d(0, 30px, -40px) rotateX(-22deg); transform-origin: 50% 100%; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
.hero { padding: 112px 0 48px; position: relative; }
.hero::before {
  content: ''; position: absolute; right: 0; top: 0; width: 42%; height: 78%;
  background: var(--cream-2); border-bottom-left-radius: 160px; z-index: -1;
}
.kicker { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; margin-bottom: .5rem; }
.hero-title { font-weight: 800; line-height: .98; font-size: clamp(2.8rem, 7vw, 5.6rem); letter-spacing: -.05em; margin-bottom: 1.25rem; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .accent { color: var(--orange); font-weight: 300; }
.split .ch { display: inline-block; transform: translate3d(0, 105%, 0) rotateX(-70deg); transform-origin: 50% 100%; opacity: 0;
  transition: transform .9s var(--ease), opacity .7s var(--ease); transition-delay: calc(var(--ci) * 28ms + .05s); }
.split.is-in .ch { transform: none; opacity: 1; }

.hero-role { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; color: var(--ink-2); font-size: 1.02rem; margin-bottom: 1.1rem; }
.hero-role strong { color: var(--ink); font-weight: 700; }
.hero-role .sep { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.hero-lead { font-size: 1.06rem; color: var(--ink-2); max-width: 34rem; border-left: 2px solid var(--sand); padding-left: 1rem; margin-bottom: 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.portrait { position: relative; max-width: 420px; margin: 0 auto; transform-style: preserve-3d; }
.portrait-img { position: relative; border-radius: 210px 210px 14px 14px; overflow: hidden; aspect-ratio: 5 / 6; box-shadow: 0 30px 60px -30px rgba(35,25,18,.45); transform: translateZ(30px); }
.portrait-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.portrait-frame { position: absolute; inset: 0; border-radius: 210px 210px 14px 14px; border: 1.5px solid var(--orange); transform: translate3d(16px, 16px, -30px); }
.portrait figcaption { position: absolute; left: -18px; bottom: 28px; background: var(--paper); border-radius: 10px; padding: .6rem .85rem; box-shadow: 0 14px 30px -16px rgba(35,25,18,.4); transform: translateZ(70px); }
.portrait figcaption img { height: 32px; width: auto; }

.factbar { display: grid; grid-template-columns: repeat(4, 1fr); margin: 48px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.factbar > div { padding: 1.1rem 1rem; border-left: 1px solid var(--rule); }
.factbar > div:first-child { border-left: 0; padding-left: 0; }
.factbar dt { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.factbar dd { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: var(--pad) 0; position: relative; }
.section-alt { background: var(--paper); }

/* about */
.about-photo { border-radius: 14px; overflow: hidden; box-shadow: 0 24px 50px -30px rgba(35,25,18,.5); }
.about-photo img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; object-position: 50% 40%; }
.glance { margin: 1.5rem 0 0; }
.glance > div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.glance > div:first-child { border-top: 1px solid var(--rule); }
.glance dt { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding-top: .15rem; }
.glance dd { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.45; }

/* experience / education CV list */
.side-head { position: sticky; top: 96px; }
.cv { list-style: none; margin: 0; padding: 0; }
.cv-item { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; padding: 1.6rem 0; border-top: 1px solid var(--rule); }
.cv-item:last-child { border-bottom: 1px solid var(--rule); }
.cv-period { font-size: .85rem; font-weight: 700; color: var(--orange); padding-top: .2rem; }
.cv-body h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .15rem; }
.cv-org { color: var(--muted); font-weight: 500; margin-bottom: .6rem; }
.cv-body ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); }
.cv-body li { margin-bottom: .35rem; }
.cv-body li::marker { color: var(--sand-2); }
.cv-note { color: var(--ink-2); margin: 0; }

/* milestones — sticky horizontal 3D scroller (height set in JS) */
.journey { position: relative; }
.journey-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.journey-head .label { margin: 0; }
.journey-bar { flex: 0 1 260px; height: 2px; background: var(--rule); overflow: hidden; }
.journey-bar span { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.journey-stage { perspective: 1200px; padding: 2rem 0; }
.journey-track { display: flex; gap: clamp(1rem, 2.5vw, 1.75rem); width: max-content; padding: 0 calc(50vw - min(180px, 41vw)); transform-style: preserve-3d; will-change: transform; }
.j-card {
  width: min(360px, 82vw); min-height: 280px; flex-shrink: 0; background: var(--paper); border-radius: 14px;
  padding: 1.75rem; border: 1px solid var(--rule); display: flex; flex-direction: column;
  will-change: transform; backface-visibility: hidden; transition: border-color .3s, box-shadow .3s;
}
.j-card.is-center { border-color: var(--orange); box-shadow: 0 30px 50px -30px rgba(242,106,27,.45); }
.j-year { font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--orange); margin-bottom: auto; }
.j-card h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; margin: 1.5rem 0 .4rem; }
.j-card p { color: var(--ink-2); font-size: .94rem; margin: 0; }

/* message */
.message { background: var(--ink); color: var(--cream); padding: var(--pad) 0; position: relative; overflow: hidden; }
.message-photo { border-radius: 12px; overflow: hidden; max-width: 260px; aspect-ratio: 4 / 5; }
.message-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; filter: saturate(.9); }
.message-text { font-size: clamp(1.1rem, 1.9vw, 1.5rem); line-height: 1.6; font-weight: 400; letter-spacing: -.01em; margin: 0 0 1.5rem; }
.message-text .w { display: inline-block; opacity: .2; transition: opacity .45s ease; }
.message-text .w.lit { opacity: 1; }
.message-sign { font-weight: 700; margin: 0; }
.message-sign span { font-weight: 400; color: var(--sand); }

/* in her words */
.quote { height: 100%; margin: 0; background: var(--paper); border-radius: 14px; padding: 1.75rem; border-top: 3px solid var(--orange); display: flex; flex-direction: column; }
.quote blockquote { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.55; font-weight: 500; letter-spacing: -.01em; margin: 0 0 1.5rem; }
.quote figcaption { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); padding-top: 1rem; border-top: 1px solid var(--rule); }
.quote figcaption a { color: var(--ink); font-weight: 600; }
.quote figcaption a:hover { color: var(--orange); }

.records { list-style: none; padding: 0; margin: 0; }
.records li { border-top: 1px solid var(--rule); }
.records li:last-child { border-bottom: 1px solid var(--rule); }
.records a { display: grid; grid-template-columns: 70px 120px 1fr 24px; gap: 1rem; align-items: baseline; padding: 1.2rem 0; transition: padding .35s var(--ease), background .35s; }
.records a:hover { padding-left: .75rem; padding-right: .75rem; background: var(--paper); }
.rec-year { font-weight: 800; color: var(--orange); }
.rec-type { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rec-body strong { display: block; font-weight: 700; line-height: 1.4; }
.rec-body small { display: block; color: var(--muted); font-size: .86rem; margin-top: .2rem; }
.rec-arrow { color: var(--muted); transition: transform .3s var(--ease), color .3s; }
.records a:hover .rec-arrow { color: var(--orange); transform: translate(3px, -3px); }

/* contact */
.contact-list { margin: 1.5rem 0; }
.contact-list > div { display: grid; grid-template-columns: 80px 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.contact-list > div:first-child { border-top: 1px solid var(--rule); }
.contact-list dt { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: .15rem; }
.contact-list dd { margin: 0; font-weight: 500; line-height: 1.5; word-break: break-word; }
.contact-list a:hover { color: var(--orange); }
.socials { display: flex; gap: .5rem; }
.socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule); color: var(--ink); transition: all .3s var(--ease); }
.socials a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

.contact-form { background: var(--cream); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--rule); }
.f-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.f-input { width: 100%; border: 1px solid var(--sand); background: var(--paper); border-radius: 8px; padding: .7rem .9rem; font: inherit; color: var(--ink); outline: none; transition: border-color .25s, box-shadow .25s; resize: vertical; }
.f-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,106,27,.15); }
.hp { position: absolute; left: -9999px; opacity: 0; }
.form-alert { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 500; font-size: .92rem; }
.form-alert.ok { background: #E4EEDC; color: #2F5A27; }
.form-alert.err { background: #FBE2D3; color: var(--orange-d); }

/* footer */
.footer { padding: 1.5rem 0; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.footer a:hover { color: var(--orange); }

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
  .hero { padding-top: 96px; }
  .hero::before { display: none; }
  .portrait { max-width: 330px; }
  .side-head { position: static; }
  .message-photo { max-width: 200px; }
}
@media (max-width: 767.98px) {
  .factbar { grid-template-columns: repeat(2, 1fr); }
  .factbar > div { padding: .9rem 0 .9rem 1rem; }
  .factbar > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .factbar > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cv-item { grid-template-columns: 1fr; gap: .4rem; padding: 1.3rem 0; }
  .records a { grid-template-columns: 56px 1fr 20px; gap: .25rem .75rem; }
  .rec-type { grid-column: 2; grid-row: 1; }
  .rec-body { grid-column: 2; }
  .rec-arrow { grid-column: 3; grid-row: 1; }
  .journey-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .journey-bar { width: 100%; flex-basis: auto; }
}
@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .container { padding-left: 16px; padding-right: 16px; }
  .brand-text { font-size: .9rem; }
  .hero { padding: 88px 0 36px; }
  .portrait { max-width: 260px; }
  .portrait figcaption { left: -8px; bottom: 18px; padding: .45rem .6rem; }
  .portrait figcaption img { height: 24px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero-role { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .hero-role .sep { display: none; }
  .factbar { margin-top: 32px; }
  .glance > div { grid-template-columns: 110px 1fr; }
  .j-card { min-height: 250px; padding: 1.4rem; }
  .message-photo { max-width: 150px; }
  .contact-list > div { grid-template-columns: 64px 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .split .ch { opacity: 1 !important; transform: none !important; transition: none !important; }
  .message-text .w { opacity: 1; }
}
