/*
  CONTENT-FIRST VIEWPORT COMPOSITION — BHAVESH portfolio, V3 experiment.
  Each section is at least one available viewport below the fixed header.
  Never cap a section's height: dense text/forms grow naturally.
  Original font sizes, colours, content, 12 kinetic letters, the project theatre,
  and every existing interaction are untouched.
*/
:root {
  --vp-header: 81px;
  --vp-content: calc(100svh - var(--vp-header));
  --vp-top: clamp(24px, 3.4svh, 37px);
  --vp-bottom: clamp(27px, 4svh, 43px);
}
/* viewport-rhythm.css previously removed both anchor offsets.  Use ONE
   scroll-margin offset; avoid accumulating scroll-padding + scroll-margin. */
html { scroll-padding-top: 0; }
#intro, #work, #about, #skills, #approach, #company, #message, #contact {
  scroll-margin-top: var(--vp-header);
}
:is(.manifesto,.work-introduction,.personal-section,.skills-section,
       .approach-section,.company-section,.message-section,.contact-section) {
  box-sizing: border-box;
  min-height: var(--vp-content);
  height: auto;
  padding-top: var(--vp-top);
  padding-bottom: var(--vp-bottom);
}
/* Intro: keep the label, statement and closing thought together. */
.manifesto { justify-content: space-between; }
.manifesto-words { padding-block: clamp(14px,2svh,25px); }

/* Work introduction has the tallest locked headline. Allocate the remaining
   height dynamically, do not crop or hide the fourth natural text line. */
.work-introduction {
  justify-content: space-between;
  row-gap: clamp(10px,1.7svh,18px);
}
.work-introduction h2 { margin-block: clamp(8px,1.45svh,16px); }
.work-intro-bottom { flex-shrink: 0; }
.work-intro-bottom p { margin-block: 0; }

/* About: a short, two-column composition centred under its own top rule. */
.personal-section {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  align-items: start;
}
.personal-section .about-grid {
  align-self: center;
  margin-top: clamp(24px,3svh,42px);
  padding-block: clamp(12px,2svh,24px);
}

/* Skills: label, headline/description, a one-line software icon ribbon,
   then the original six skill rows. No duplicated skill text, no cards. */
.skills-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.skills-section .skills-grid {
  flex: 0 0 auto;
  margin-top: clamp(18px,2.4svh,29px);
}
.skills-section .skills-list {
  margin-top: clamp(11px,1.4svh,17px);
}
.skills-section .skills-list li {
  min-height: 0;
  padding-block: clamp(3px,.56svh,7px);
}
.skills-section .skills-intro { gap: clamp(15px,2svh,23px); }

/* How I Work: heading and four steps occupy an intentional viewport, with
   no enormous fixed blank band between them. */
.approach-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.approach-section .approach-heading {
  margin-top: clamp(25px,3.2svh,36px);
  margin-bottom: clamp(27px,4svh,47px);
}

/* Company: content is richer, so use block flow that grows if necessary. */
.company-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.company-section .company-topline {
  margin-bottom: clamp(19px,2.5svh,28px);
}
.company-section .company-heading {
  margin-bottom: clamp(22px,3svh,36px);
}
.company-section .company-heading > p {
  margin-top: clamp(12px,1.65svh,20px);
}
.company-section .company-roles {
  padding-top: clamp(15px,2.25svh,23px);
}
.company-section .company-other {
  margin-top: clamp(21px,2.9svh,32px);
  padding-top: clamp(17px,2.3svh,25px);
}
.company-section .company-other-projects {
  margin-top: clamp(16px,2.1svh,23px);
}

/* Contact form: one readable composition, not part Company + part Contact
   during an anchor jump. It still expands when text fields expand. */
.message-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.message-section .message-layout {
  margin-top: clamp(23px,3.2svh,37px);
}
.message-section .message-form {
  gap: clamp(12px,1.6svh,18px);
}

/* Final contact: full closing scene with the CTA and footer both in view. */
.contact-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.contact-section h2 {
  margin-top: clamp(18px,2.5svh,27px);
  margin-bottom: clamp(18px,2.7svh,31px);
}
.contact-section .contact-bottom {
  margin-bottom: clamp(24px,3.2svh,37px);
}
.contact-section .footerline { flex: 0 0 auto; }

/* One continuous ribbon of real self-hosted SVG brand marks. */
.software-ribbon {
  margin-top: clamp(12px,1.75svh,19px);
  margin-bottom: 0;
  border-top: 1px solid rgba(255,255,255,.20);
  border-bottom: 1px solid rgba(255,255,255,.20);
  position: relative;
  isolation: isolate;
}
.software-ribbon__window {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding-block: clamp(8px,1.12svh,12px);
  outline-offset: 4px;
}
.software-ribbon__window:focus-visible {
  outline: 2px solid #d9f64e;
}
.software-ribbon__window::before,
.software-ribbon__window::after {
  content:"";
  position:absolute;
  z-index:2;
  top:0;
  bottom:0;
  width:clamp(16px,5vw,75px);
  pointer-events:none;
}
.software-ribbon__window::before {
  left:0;
  background:linear-gradient(90deg,#101010,transparent);
}
.software-ribbon__window::after {
  right:0;
  background:linear-gradient(270deg,#101010,transparent);
}
.software-ribbon__track {
  display:flex;
  width:max-content;
  will-change:transform;
  animation:software-march 52s linear infinite;
}
.software-ribbon__set {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:clamp(11px,1.55vw,19px);
  padding-right:clamp(11px,1.55vw,19px);
}
.software-ribbon__icon {
  display:grid;
  flex:0 0 auto;
  place-items:center;
  box-sizing:border-box;
  width:clamp(49px,4.7svh,58px);
  height:clamp(49px,4.7svh,58px);
  padding:9px;
  background:#f2f0e9;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
}
.software-ribbon__icon--inverse {
  background:#262728;
  border-color:rgba(255,255,255,.22);
}
.software-ribbon__icon img {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  user-select:none;
  pointer-events:none;
}
@keyframes software-march {
  to { transform:translate3d(-50%,0,0); }
}
.software-ribbon__window:hover .software-ribbon__track,
.software-ribbon__window:focus-visible .software-ribbon__track {
  animation-play-state:paused;
}

/* Tablets: the original headings stay their current size; dense content
   simply gets natural document height rather than being forced into a crop. */
@media (max-width:1050px) {
  .skills-section .skills-list { margin-top:clamp(16px,2.5svh,26px); }
  .personal-section .about-grid { padding-block:clamp(9px,1.5svh,19px); }
}
@media (max-width:850px) {
  :root {
    --vp-top: clamp(22px,3svh,34px);
    --vp-bottom: clamp(32px,4.5svh,48px);
  }
  .skills-section .skills-grid {margin-top:clamp(19px,2.6svh,29px)}
  .skills-section .skills-list li {padding-block:clamp(7px,1.3svh,12px)}
  .skills-section .skills-intro {gap:clamp(15px,2.3svh,25px)}
  .skills-section .skills-list {margin-top:clamp(18px,2.5svh,29px)}
  .software-ribbon {margin-top:clamp(17px,2.7svh,25px)}
  .contact-section .contact-bottom {margin-bottom:clamp(26px,4svh,42px)}
}
@media (max-width:800px) {
  :root {--vp-header:70px}
}
@media (max-width:600px) {
  :root {
    --vp-top:clamp(25px,3.8svh,41px);
    --vp-bottom:clamp(34px,4.8svh,52px);
  }
  /* All mobile sections can exceed a viewport without scaling or clipping. */
  .personal-section .about-grid {margin-top:clamp(25px,3.7svh,36px)}
  .skills-section .skills-list li {padding-block:clamp(8px,1.25svh,13px)}
  .skills-section .skills-list {margin-top:clamp(17px,2.4svh,26px)}
  .message-section .message-layout {margin-top:clamp(27px,4svh,39px)}
  .contact-section h2 {margin-block:clamp(22px,3.2svh,35px)}
  .software-ribbon__window {padding-block:10px}
  .software-ribbon__track {animation-duration:58s}
}
@media (max-height:760px) and (min-width:1051px) {
  :root {--vp-top:18px;--vp-bottom:21px}
  .skills-section .skills-grid {margin-top:17px}
  .skills-section .skills-list {margin-top:9px}
  .skills-section .skills-list li {padding-block:3px}
  .software-ribbon {margin-top:11px}
  .software-ribbon__window {padding-block:6px}
  .work-introduction h2 {margin-block:5px}
  .contact-section h2 {margin-block:16px 19px}
  .contact-section .contact-bottom {margin-bottom:20px}
}
@media (prefers-reduced-motion:reduce) {
  .software-ribbon__track {animation:none;will-change:auto}
  .software-ribbon__set[aria-hidden="true"] {display:none}
  .software-ribbon__window {
    overflow-x:auto;
    scrollbar-width:thin;
    scrollbar-color:#aeb9aa #101010;
  }
  .software-ribbon__window::before,
  .software-ribbon__window::after {display:none}
}


/*
  MANIFESTO / GOOD SOFTWARE — one-section viewport composition.
  Keep approved type sizes, line effects, colours, text and scroll motion intact.
  Put the closing explanation in the natural space beside "TO DO" on
  wide screens; let smaller screens stack everything without clipping.
  No global spacing or animation-engine changes.
*/
.manifesto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: clamp(12px, 1.5svh, 18px);
  align-content: stretch;
}
.manifesto-topline {
  grid-row: 1;
  grid-column: 1;
}
.manifesto-words {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  min-width: 0;
  padding-block: 0;
}
.manifesto-foot {
  grid-row: 2;
  grid-column: 1;
  align-self: end;
  justify-self: end;
  width: 56%;
  margin-bottom: 0;
  padding-top: clamp(12px, 1.7svh, 20px);
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(8px, 1.1svh, 13px);
}
.manifesto-foot span {
  align-self: flex-start;
  text-align: left;
}
@media (max-width: 1050px) {
  .manifesto {
    display: flex;
    flex-direction: column;
    gap: clamp(15px, 2.4svh, 26px);
  }
  .manifesto-words {
    align-self: stretch;
    padding-block: 0;
  }
  .manifesto-foot {
    justify-self: auto;
    align-self: stretch;
    width: 100%;
    margin-top: clamp(13px, 2svh, 22px);
    padding-top: clamp(17px, 2svh, 25px);
  }
}


/*
  SELECTED WORK — content-first composition, original wording unchanged.
  The words occupy three deliberate lines (and wrap naturally when needed).
  Keep the existing scroll-linked BUSINESSES reveal, typography family,
  colours, other sections and every kinetic animation source unchanged.
  Grid fills the available width; never force nowrap on the heading.
*/
.work-introduction {
  min-height: var(--vp-content);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  row-gap: clamp(14px, 2.4svh, 26px);
  align-items: start;
}
.work-introduction #work-headline {
  font-size: clamp(25px, 8.1vw, 136px);
  line-height: .96;
  letter-spacing: -.057em;
  white-space: normal;
  margin: 0;
  align-self: center;
  max-width: 100%;
  min-width: 0;
}
.work-introduction #work-headline > span,
.work-introduction #work-headline > em {
  display: block;
  width: fit-content;
  max-width: 100%;
}
.work-introduction #work-headline > br { display: none; }
.work-introduction .work-intro-bottom {
  align-items: flex-end;
  gap: clamp(15px, 3vw, 38px);
}
.work-introduction .work-intro-bottom p { max-width: 580px; }
@media (max-width: 1100px) {
  .work-introduction .work-intro-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(12px, 2svh, 20px);
  }
  .work-introduction .work-indicator { align-self: flex-end; }
}
@media (max-width: 600px) {
  .work-introduction { row-gap: clamp(15px, 2.8svh, 25px); }
  .work-introduction #work-headline { font-size: clamp(25px, 8.8vw, 54px); }
  .work-introduction .work-intro-bottom { gap: clamp(15px, 2.5svh, 22px); }
  .work-introduction .work-indicator {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
    gap: 10px;
  }
  .work-introduction .work-indicator-line { flex: none; width: 32px; }
  .work-introduction .tiny-line { gap: 12px; }
  .work-introduction .tiny-line span:last-child { text-align: right; }
}


/*
  ABOUT ONLY — desktop optical-centre correction.
  Keep approved two-column grid, typography, copy, colours and all motion.
  Redistribute existing whitespace without forcing viewport height or clipping.
  Tablet and mobile compositions retain their currently fitting layouts.
*/
@media (min-width: 1051px) {
  .personal-section .about-grid {
    margin-top: 0;
    margin-bottom: clamp(70px, 10svh, 110px);
    padding-block: 0;
  }
}


/*
  SKILLS — approved balanced composition, no design-system changes.
  Same wording, heading colours, self-hosted software ribbon and animation.
  Desktop: one-line headline plus description; six skills in three columns.
  Tablet: two columns; mobile: readable natural stack.
  No cards, decorative borders or changes outside Skills.
*/
.skills-section .skills-grid {
  margin-top: clamp(16px, 2.1svh, 24px);
}
.skills-section .skills-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(8px, 1.3svh, 15px);
}
.skills-section .skills-intro h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .14em;
  max-width: 100%;
  white-space: normal;
}
.skills-section .skills-intro p {
  max-width: 66ch;
  margin: 0;
}
.skills-section .skills-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(18px, 3vw, 46px);
  row-gap: clamp(22px, 3svh, 32px);
  margin-top: clamp(19px, 2.5svh, 29px);
}
.skills-section .skills-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: clamp(6px, .9svh, 10px);
  min-height: 0;
  padding: 0;
  margin: 0;
}
.skills-section .skills-list li p {
  max-width: 35ch;
}
@media (max-width: 1050px) {
  .skills-section .skills-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(20px, 4vw, 42px);
    row-gap: clamp(20px, 2.8svh, 29px);
  }
  .skills-section .skills-intro h2 {
    font-size: clamp(52px, 7.25vw, 78px);
  }
}
@media (max-width: 600px) {
  .skills-section .skills-intro h2 {
    font-size: clamp(44px, 10.6vw, 62px);
    line-height: 1.04;
  }
  .skills-section .skills-list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(16px, 2.5svh, 24px);
    margin-top: clamp(19px, 2.8svh, 28px);
  }
  .skills-section .skills-list li {
    gap: 5px;
  }
}


/*
  SKILLS — scoped width and alignment repair (approved).
  Bound the marquee's max-content track inside its intended viewport, and
  distribute genuine section content without stretching the six-skill list.
  Original text, colours, fonts, 27 logo assets, timing and animations remain.
  No body-level overflow masking or changes to other page sections.
*/
.skills-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding-top: clamp(25px, 3.2svh, 36px);
  padding-bottom: clamp(28px, 4svh, 43px);
}
.skills-section .skills-grid {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  justify-content: space-between;
  gap: clamp(17px, 2.8svh, 28px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: clamp(20px, 2.8svh, 31px);
}
.skills-section .skills-intro {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}
.skills-section .software-ribbon {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
}
.skills-section .software-ribbon__window {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.skills-section .skills-list {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  column-gap: clamp(18px, 3vw, 46px);
  row-gap: clamp(24px, 3.3svh, 35px);
}
.skills-section .skills-list li {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 1050px) {
  .skills-section {
    padding-top: clamp(28px, 3.8svh, 40px);
    padding-bottom: clamp(35px, 4.5svh, 50px);
  }
  .skills-section .skills-grid {
    display: block;
    flex: 0 0 auto;
    margin-top: clamp(23px, 3.1svh, 33px);
  }
  .skills-section .software-ribbon {
    margin-top: clamp(26px, 3.6svh, 39px);
  }
  .skills-section .skills-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: clamp(27px, 3.5svh, 37px);
    row-gap: clamp(20px, 2.8svh, 30px);
  }
}
@media (max-width: 600px) {
  .skills-section {
    padding-top: clamp(26px, 3.6svh, 36px);
    padding-bottom: clamp(33px, 4.5svh, 46px);
  }
  .skills-section .skills-grid {
    margin-top: clamp(22px, 2.8svh, 31px);
  }
  .skills-section .software-ribbon {
    margin-top: clamp(17px, 2.5svh, 25px);
  }
  .skills-section .skills-list {
    grid-template-columns: minmax(0, 1fr);
    margin-top: clamp(20px, 2.9svh, 28px);
    row-gap: clamp(17px, 2.5svh, 24px);
  }
}
