/* ============================================================
   VANSHAJ KAUL — PORTFOLIO  (rev 2)
   Minimal gallery style after cathydolle.com
   ============================================================ */

:root {
  /* Cool Concrete & Copper */
  --bg: #EFEFED;
  --ink: #141414;
  --ink-soft: #737373;
  --ink-faint: #737373;
  --accent: #8C6E4B;
  --line: #D2D2D0;
  --ui-size: 11px;
  --ui-track: 0.14em;
  --col-w: min(58vw, 980px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Hidden scrollbar, scrolling still functional */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: inherit;
}

/* ---------- UI text (small caps utility) ---------- */
.ui,
.nav-link,
.project-list,
.project-nav,
.page-label,
.info-label {
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  text-transform: uppercase;
}

/* ---------- Nav links: underline sweep ---------- */
.nav-link {
  position: relative;
  display: inline-block;
  padding: 2px 0;
  transition: color 0.3s ease;
}
.nav-link:hover,
.nav-link:focus-visible { color: var(--accent); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s var(--ease);
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}
.nav-link:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ============================================================
   PRELOADER (Rounds 1-3) — re-enabled as the interstitial shown
   between the home page and the Projects page. Topmost overlay,
   opaque until settle.
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease);
}
.preloader.is-done { opacity: 0; pointer-events: none; }
.preloader[hidden] { display: none; }

.preloader__counter {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: calc(50% + min(26vh, 280px) + 26px);
  transform: translateX(-50%);
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.preloader__stack {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader__frame {
  position: absolute;
  width: min(40vw, 480px);
  height: min(52vh, 560px);
  overflow: hidden;
}
.preloader__frame img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}
.preloader__frame img.is-shown {
  opacity: 1;
  animation: stack-reveal 0.45s var(--ease);
}
@keyframes stack-reveal {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.preloader.is-settling .preloader__stack {
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
  opacity: 0;
  transform: translateY(-4vh) scale(0.985);
}

/* ============================================================
   HEADER / FOOTER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 28px;
  mix-blend-mode: darken;
}
.site-header__nav { display: flex; gap: 2.6rem; }
.site-header__left { display: flex; align-items: baseline; gap: 2.6rem; }

/* "Projects" header button — shown on About, Thesis and project pages only */
.site-header__projects { display: none; }
body.on-about .site-header__projects,
body.on-thesis .site-header__projects,
body.on-project .site-header__projects { display: inline-block; }


.site-header {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
body.is-ready .site-header { opacity: 1; }

/* ============================================================
   HOME — LEFT PROJECT LIST (fixed, vertically centred)
   ============================================================ */
.project-list {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  mix-blend-mode: darken;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
body.on-feed .project-list { opacity: 1; pointer-events: auto; }
.project-list button {
  display: block;
  color: var(--ink-faint);
  transition: color 0.35s ease;
  padding: 1px 0;
  max-width: min(18vw, 280px);
  line-height: 1.55;
}
.project-list button:hover,
.project-list button.is-active { color: var(--accent); }
.project-list button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.project-list .num { margin-right: 0.8em; }

/* ============================================================
   HOME — INFINITE FEED
   ============================================================ */
.home {
  position: relative;
  z-index: 35;
  background: var(--bg);
  padding: 14vh 0 8vh;
  transition: opacity 0.35s ease;
}
.home[hidden] { display: none; }
.home.is-sliding {
  transition: transform 0.65s var(--ease), opacity 0.35s ease;
  will-change: transform;
}
.home.is-leaving { opacity: 0; }

.feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7vh;
}

.feed-item {
  position: relative;
  width: var(--col-w);
}

.feed-item__media {
  display: block;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  cursor: pointer;
  padding: 0;
}
.feed-item.in-view .feed-item__media { opacity: 1; transform: none; }

.feed-item__media .zoom {
  display: block;
  overflow: hidden;
  transition: transform 0.9s var(--ease);
}
.feed-item.is-center .feed-item__media:hover .zoom { transform: scale(1.035); }
.feed-item__media img {
  width: 100%;
  height: auto;
  transform: scale(1.12) translateY(var(--py, 0px));
  will-change: transform;
}

/* ============================================================
   SUBPAGES (about / thesis / contact / project)
   ============================================================ */
.page {
  position: relative;
  z-index: 60;
  min-height: 100vh;
  background: var(--bg);
  padding: 19vh 28px 16vh;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.page.is-shown { opacity: 1; transform: none; }

.page-inner { max-width: 1100px; margin: 0 auto; }
.page-inner--narrow { max-width: 620px; }
.page-inner--about { max-width: 880px; }
.page--about p, .page--thesis p { max-width: none; }
.about-section { margin-top: 4.5rem; }
.about-section h2 {
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.1em;
}
.about-section p { margin-bottom: 0.35em; }

.page-label {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 3rem;
}

.page h1 {
  font-size: clamp(26px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-bottom: 5vh;
}
.page h1 .num { color: var(--ink-soft); margin-right: 0.5em; }

.page p { margin-bottom: 1.4em; max-width: 62ch; }
.thesis-lede { font-size: 17px; line-height: 1.65; }

/* ============================================================
   THESIS PAGE — ported from the "Monolith" (thesispage) layout,
   recoloured to Cool Concrete & Copper. Serif display type +
   stats grid + lede + body, on the light palette.
   ============================================================ */
.thesis-page { max-width: 1020px; }
.thesis-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.thesis-title {
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.12;
  color: var(--ink);
  text-transform: none;
  font-size: clamp(28px, 3.6vw, 52px);
  max-width: 26ch;
  margin: 18px 0 36px;
}
.thesis-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 880px;
  margin-bottom: 4px;
}
.thesis-stat {
  border: 1px solid var(--line);
  padding: 18px 18px 15px;
}
.thesis-stat b {
  display: block;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.thesis-stat span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}
.thesis-lede {
  margin: 36px 0 1.5em;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 68ch;
}
.thesis-body p {
  margin: 0 0 1.5em;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  max-width: 70ch;
}

@media (max-width: 860px) {
  .thesis-stats { grid-template-columns: repeat(2, 1fr); }
}
.placeholder-note { color: var(--ink-soft); font-size: 13px; }

/* ---------- Project page ---------- */
.project-hero {
  overflow: hidden;
  margin-bottom: 7vh;
  animation: hero-in 0.9s var(--ease);
}
@keyframes hero-in {
  from { opacity: 0; transform: scale(0.975); }
  to   { opacity: 1; transform: none; }
}
.project-hero img { width: 100%; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3.2rem 3rem;
  padding-top: 4vh;
  border-top: 1px solid var(--line);
}
.info-cell--wide { grid-column: 1 / -1; }
.info-label {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 0.7em;
}
.info-value { font-size: 14px; }
.info-grid p.info-value { max-width: none; }

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 12vh;
  padding-top: 3vh;
  border-top: 1px solid var(--line);
}
.project-nav button { max-width: 44%; }
.project-nav .dir { color: var(--ink-soft); margin-right: 0.9em; }
.project-nav__next { text-align: right; }
.project-nav__next .dir { margin-right: 0; margin-left: 0.9em; }

.page--project { padding-top: 9.5vh; }
.back-link { display: inline-block; margin-bottom: 6vh; color: var(--ink-soft); }
.back-link:hover { color: var(--accent); }

/* ---------- Profile (home) ---------- */
.profile {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  transition: transform 0.65s var(--ease), opacity 0.65s var(--ease);
}
.profile.is-pushed { transform: translateX(-28%); opacity: 0; pointer-events: none; }
.profile[hidden] { display: none; transform: none; opacity: 1; }
.profile .contact-split { height: 100vh; }
.profile .contact-details { padding-right: calc(8vw + 44px); }

.contact-actions {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-top: -1.2rem;
}
.icon-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.3s ease, color 0.3s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.mini-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 14px);
  z-index: 5;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 20px 44px 18px 20px;
  box-shadow: 0 12px 40px rgba(17, 17, 16, 0.08);
}
.mini-pop .info-label { margin-bottom: 0.5em; }
.mini-pop a { font-size: 14px; }
.mini-pop a:hover { color: var(--accent); }
.mini-pop__close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  padding: 4px;
}
.mini-pop__close:hover { color: var(--ink); }

.synopsis { max-width: 46ch; }
.contact-details .synopsis,
.contact-details .btn-linkedin { transition: transform 0.45s var(--ease); }
.contact-details.pop-open .synopsis,
.contact-details.pop-open .btn-linkedin { transform: translateY(var(--pop-shift, 130px)); }

.btn-linkedin {
  align-self: flex-start;
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 12px 26px;
  transition: background 0.3s ease, color 0.3s ease;
}
.btn-linkedin:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Projects strip — extreme right edge, slightly darker, expands on hover.
   The arrow sits inside the collapsed strip so it is always visible;
   only the "Projects" label is revealed on hover. */
.projects-strip {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 44px;
  background: #E4E4E1;
  overflow: hidden;
  transition: width 0.5s var(--ease), background 0.3s ease;
  z-index: 6;
}
.projects-strip:hover,
.projects-strip:focus-visible { width: 210px; background: #DEDEDB; }
.projects-strip__inner {
  position: absolute;
  top: 50%;
  left: 0;
  width: 210px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 13px;
  color: var(--ink);
}
.projects-strip svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent); }
.projects-strip__label {
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.35s ease 0.08s, transform 0.35s var(--ease) 0.08s;
  white-space: nowrap;
}
.projects-strip:hover .projects-strip__label,
.projects-strip:focus-visible .projects-strip__label { opacity: 1; transform: none; }

/* ---------- Contact page (layout classes reused by profile) ---------- */
.page--contact { padding: 0; display: flex; height: 100vh; overflow: hidden; }
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}
body.on-contact .site-header { mix-blend-mode: normal; }
body.on-contact .site-header__nav { display: none; }
body.on-project .site-header { mix-blend-mode: normal; background: var(--bg); }
body.on-contact .site-header__name { color: #fff; }

.contact-photo {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.contact-photo .placeholder-note { letter-spacing: var(--ui-track); text-transform: uppercase; font-size: var(--ui-size); }
.contact-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12vh 8vw;
  gap: 3.2rem;
}
.contact-details h1 { margin-bottom: 0; text-transform: none; letter-spacing: 0; font-size: clamp(28px, 3.6vw, 46px); }
.contact-line .info-label { margin-bottom: 0.4em; }
.contact-line a:hover { color: var(--accent); }

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 90;
  pointer-events: none;
  font-size: var(--ui-size);
  font-weight: 500;
  letter-spacing: var(--ui-track);
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 6px 10px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.25s ease;
  white-space: nowrap;
}
.cursor.is-active { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  :root { --col-w: 72vw; }

  .site-header { padding: 18px 20px; }
  .site-header__nav { gap: 1.4rem; }
  .site-header__left { gap: 1.4rem; }

  .home { padding-top: 13vh; }
  .feed { gap: 6vh; align-items: flex-end; }
  .feed-item { margin-right: 5vw; }

  .project-list { left: 16px; gap: 0.7em; }
  .project-list button {
    font-size: 9px;
    max-width: 20vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .info-grid { grid-template-columns: 1fr 1fr; gap: 2.2rem 1.6rem; }

  .page--contact { height: auto; min-height: 100vh; overflow: visible; }
  .profile { position: absolute; min-height: 100vh; }
  .profile .contact-split { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: 46vh auto; }
  .profile .contact-details { padding: 6vh 56px 12vh 20px; }
  .projects-strip { width: 36px; }
  .projects-strip:hover, .projects-strip:focus-visible { width: 170px; }
  .projects-strip__inner { padding-left: 9px; }
  .contact-split { grid-template-columns: 1fr; grid-template-rows: 52vh auto; height: auto; min-height: 100vh; }
  .contact-details { padding: 8vh 20px 14vh; }
}

@media (max-width: 520px) {
  .site-header__nav { gap: 1rem; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  .feed-item__media img { transform: none !important; }
}
