/* All Projects page.
   Loads after main.css and reuses its tokens, reset, grain, buttons and footer.
   Layout: a sticky index rail on the left, one full-height deck per project
   on the right, with the rail tracking whichever deck holds the viewport. */

/* ---------- category icons ----------
   The .icon base rule lives in main.css so both pages can use it; a modifier
   only has to name the file. */

.icon--wordpress {
  --icon: url("../assets/icons/wordpress.svg");
}

.icon--react {
  --icon: url("../assets/icons/react.svg");
}

.icon--mobile {
  --icon: url("../assets/icons/mobile.svg");
}

.icon--web {
  --icon: url("../assets/icons/web.svg");
}

.icon--work {
  --icon: url("../assets/icons/work.svg");
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.9rem 1.4rem;
  background: var(--emerald);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip:focus {
  left: 0;
}

/* ---------- top bar ---------- */

.wnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: rgba(10, 11, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.wnav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  transition: color 0.3s ease;
}

.wnav__back-arrow {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--emerald);
  transition: transform 0.4s var(--ease);
}

.wnav__back:hover {
  color: var(--emerald);
}

.wnav__back:hover .wnav__back-arrow {
  transform: translateX(-5px);
}

.wnav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.8rem);
}

.wnav__gh {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.3s ease;
}

.wnav__gh:hover {
  color: var(--emerald);
}

/* ---------- shell ---------- */

.wrk {
  display: grid;
  grid-template-columns: clamp(230px, 21vw, 310px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ---------- index rail ---------- */

.wrk__index {
  position: sticky;
  top: 68px;
  align-self: start;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 6vh, 3.4rem) 0 clamp(1.5rem, 4vh, 2.5rem);
  border-right: 1px solid var(--hairline);
}

.wrk__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-right: 1.5rem;
  margin-bottom: 1.4rem;
}

.wrk__title-icon {
  width: 14px;
  height: 14px;
  opacity: 0.65;
}

.wrk__title b {
  color: var(--emerald);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.wrk__nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 237, 227, 0.18) transparent;
}

.wrk__nav::-webkit-scrollbar {
  width: 4px;
}

.wrk__nav::-webkit-scrollbar-thumb {
  background: rgba(242, 237, 227, 0.18);
}

/* the entry that sits above the project index */

.wrk__link--lead {
  grid-template-columns: 1.4rem minmax(0, 1fr);
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
  border-radius: 3px 3px 0 0;
}

.wrk__lead-icon {
  width: 15px;
  height: 15px;
  opacity: 0.8;
}

/* one category block in the rail */

.wrk__group + .wrk__group {
  margin-top: 1.5rem;
}

.wrk__group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 237, 227, 0.42);
  transition: color 0.4s ease;
}

.wrk__group-icon {
  width: 15px;
  height: 15px;
  opacity: 0.75;
  transition: opacity 0.4s ease;
}

.wrk__group-sub {
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: none;
  color: rgba(242, 237, 227, 0.3);
}

/* the category holding the viewport lights up with its project */
.wrk__group.is-current .wrk__group-head {
  color: var(--emerald);
}

.wrk__group.is-current .wrk__group-icon {
  opacity: 1;
}

.wrk__group.is-current .wrk__group-sub {
  color: rgba(25, 201, 140, 0.6);
}

.wrk__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.wrk__link {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  padding: 0.62rem 0.8rem;
  color: var(--cream-dim);
  border-radius: 3px;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.wrk__num {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: rgba(242, 237, 227, 0.3);
  transition: color 0.3s ease;
}

.wrk__name {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}

.wrk__link:hover {
  color: var(--cream);
  background: rgba(242, 237, 227, 0.045);
}

.wrk__link:hover .wrk__num {
  color: rgba(242, 237, 227, 0.55);
}

.wrk__link.is-active {
  color: var(--cream);
  background: rgba(25, 201, 140, 0.1);
  box-shadow: inset 2px 0 0 var(--emerald);
}

.wrk__link.is-active .wrk__num {
  color: var(--emerald);
}

.wrk__more {
  padding: 1.4rem 0.8rem 0;
  margin-right: 1rem;
  border-top: 1px solid var(--hairline);
}

.wrk__more-label {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(242, 237, 227, 0.4);
  margin-bottom: 0.7rem;
}

.wrk__more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.wrk__more-btn:hover {
  color: var(--emerald);
  border-color: var(--emerald);
}

/* ---------- decks ---------- */

.wrk__decks {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- experience ----------
   A timeline down the left, one dot per company, with roles held at the same
   place nested under it. Deliberately plain: this is reference information,
   and it sits above the project decks that carry the visual weight. */

.cv__list {
  list-style: none;
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  padding-bottom: clamp(3rem, 8vh, 5rem);
  scroll-margin-top: 68px;
}

.cv__item {
  position: relative;
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 0 clamp(1.1rem, 2.2vw, 1.9rem);
  padding-bottom: clamp(2.2rem, 5vh, 3.4rem);
}

/* the line running between the dots */
.cv__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 1.5rem;
  bottom: 0;
  width: 1px;
  background: var(--hairline);
}

.cv__dot {
  width: 13px;
  height: 13px;
  margin-top: 0.55rem;
  border: 2px solid rgba(242, 237, 227, 0.28);
  border-radius: 50%;
  background: var(--ink);
}

/* the role still running gets the accent */
.cv__item--current .cv__dot {
  border-color: var(--emerald);
  background: var(--emerald);
}

.cv__period {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-variant-numeric: tabular-nums;
}

.cv__dur {
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: rgba(242, 237, 227, 0.5);
}

.cv__item--current .cv__dur {
  border-color: rgba(25, 201, 140, 0.4);
  color: var(--emerald);
}

.cv__role {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  line-height: 1;
  color: var(--cream);
  margin: 0.65rem 0 0.55rem;
}

.cv__org {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: rgba(242, 237, 227, 0.76);
}

.cv__org span,
.cv__place span {
  color: rgba(242, 237, 227, 0.3);
  margin: 0 0.2rem;
}

.cv__place {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: var(--cream-dim);
}

/* two roles at the same company */
.cv__roles {
  list-style: none;
  margin-top: 1.5rem;
  padding-left: clamp(1rem, 2vw, 1.6rem);
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.cv__subrole {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1;
  color: var(--cream);
  margin-bottom: 0.4rem;
}

.cv__roles .cv__org {
  font-size: 0.9rem;
  color: var(--cream-dim);
}

/* the band that announces a category in the deck stream */

.cat__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: clamp(3.5rem, 9vh, 6rem) 0 clamp(1.25rem, 3vh, 2rem);
  border-bottom: 1px solid var(--hairline);
}

.wrk__decks > :first-child .cat__head {
  padding-top: calc(68px + clamp(2rem, 6vh, 3.5rem));
}

.cat__icon {
  width: clamp(24px, 2.4vw, 32px);
  height: clamp(24px, 2.4vw, 32px);
  color: var(--emerald);
}

.cat__title {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.cat__title em {
  font-style: normal;
  color: rgba(242, 237, 227, 0.42);
}

.cat__count {
  flex: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 237, 227, 0.4);
}

.cat__count span {
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}

/* a category header already opens the run, so its first deck does not
   need the divider that separates decks inside a category */
.cat__head + .deck {
  border-top: none;
}

.deck {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4.5rem);
  padding: clamp(3.5rem, 10vh, 6.5rem) 0;
  /* clear the fixed nav when a rail link scrolls this deck to the top */
  scroll-margin-top: 68px;
}

/* the category header has just introduced this one, so it needs less air */
.cat__head + .deck {
  padding-top: clamp(2rem, 6vh, 4rem);
}

.deck + .deck {
  border-top: 1px solid var(--hairline);
}

/* a desktop shot is landscape, so it earns the wider half of the split */
.deck--wide {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

/* visual */

.deck__visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.deck__glow {
  position: absolute;
  inset: 12% 4%;
  background: radial-gradient(60% 50% at 50% 45%, rgba(25, 201, 140, 0.16), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.deck__frame {
  position: relative;
  width: 100%;
  border: 1px solid rgba(242, 237, 227, 0.16);
  overflow: hidden;
  background: var(--ink-2);
  box-shadow: 0 40px 90px -34px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(242, 237, 227, 0.06);
}

.deck__frame img,
.deck__frame .schematic {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* phone */

.deck__frame--mobile {
  max-width: 330px;
  aspect-ratio: 360 / 640;
  border-radius: 26px;
}

/* browser window: the chrome bar is real markup, so each project can carry
   its own address, and the shot below it keeps its natural 16:10 */

.deck__frame--desktop {
  max-width: 580px;
  border-radius: 10px;
}

.deck__chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.85rem;
  background: rgba(242, 237, 227, 0.05);
  border-bottom: 1px solid rgba(242, 237, 227, 0.1);
}

.deck__chrome > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(242, 237, 227, 0.18);
}

.deck__url {
  flex: 1;
  min-width: 0;
  margin-left: 0.55rem;
  padding: 0.18rem 0.7rem;
  border-radius: 4px;
  background: rgba(242, 237, 227, 0.05);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: rgba(242, 237, 227, 0.34);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck__frame--desktop img,
.deck__frame--desktop .schematic {
  height: auto;
  aspect-ratio: 16 / 10;
}

/* body */

.deck__body {
  min-width: 0;
}

.deck__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.deck__eyebrow-icon {
  width: 13px;
  height: 13px;
  color: var(--emerald);
}

.deck__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
  line-height: 0.94;
  color: var(--cream);
  margin: 0.9rem 0 1.05rem;
}

.deck__lead {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  color: var(--cream-dim);
  max-width: 46ch;
}

.deck__points {
  list-style: none;
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 54ch;
}

.deck__points li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(242, 237, 227, 0.76);
}

.deck__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--emerald);
}

.deck__stack-label {
  margin-top: 2rem;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(242, 237, 227, 0.4);
}

.deck__stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.deck__stack li {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--hairline);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(242, 237, 227, 0.72);
}

.deck__actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn--sm {
  padding: 0.8rem 1.6rem;
  font-size: 0.78rem;
}

/* ---------- outro ---------- */

.wrk__outro {
  border-top: 1px solid var(--hairline);
  padding: clamp(4rem, 12vh, 8rem) 0;
}

.wrk__outro-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.94;
  color: var(--cream);
}

.wrk__outro-actions {
  margin-top: clamp(2rem, 5vh, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- reveal (only armed once works.js runs) ---------- */

body.wrk-js .wrk-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

body.wrk-js .wrk-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .wrk {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .wrk__index {
    position: sticky;
    top: 68px;
    height: auto;
    z-index: 80;
    display: block;
    padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
    margin: 0 calc(-1 * clamp(1.25rem, 4vw, 3rem));
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    background: rgba(10, 11, 10, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .wrk__title {
    margin-bottom: 0.75rem;
    padding-right: 0;
  }

  /* the rail becomes one horizontal strip: category icon, then its chips */
  .wrk__nav {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    scrollbar-width: none;
  }

  .wrk__nav::-webkit-scrollbar {
    display: none;
  }

  .wrk__link--lead {
    flex: none;
    grid-template-columns: auto auto;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    white-space: nowrap;
  }

  .wrk__group {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .wrk__group + .wrk__group {
    margin-top: 0;
    padding-left: 0.9rem;
    border-left: 1px solid var(--hairline);
  }

  .wrk__group-head {
    padding: 0;
  }

  /* the deck stream still announces each category in full, so the strip
     keeps only the icon; the words stay in the DOM for screen readers */
  .wrk__group-name,
  .wrk__group-sub {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .wrk__group-icon {
    width: 18px;
    height: 18px;
  }

  .wrk__list {
    flex-direction: row;
    gap: 0.45rem;
    width: max-content;
    padding-bottom: 0.15rem;
  }

  .wrk__link {
    grid-template-columns: auto auto;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    white-space: nowrap;
  }

  .wrk__link.is-active {
    box-shadow: none;
    border-color: var(--emerald);
  }

  .wrk__name {
    font-size: 0.82rem;
  }

  .wrk__more {
    display: none;
  }

  .deck,
  .deck--wide {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 6vh, 3.5rem);
    padding: clamp(3rem, 8vh, 4.5rem) 0;
    /* here the nav and the pinned chip strip both overlay the deck */
    scroll-margin-top: 168px;
  }

  .deck__frame--mobile {
    max-width: 290px;
  }

  .deck__frame--desktop {
    max-width: 620px;
  }

  .cat__head {
    padding-top: clamp(2.5rem, 7vh, 4rem);
  }

  .cv__list {
    scroll-margin-top: 168px;
  }

  .cv__item {
    grid-template-columns: 11px minmax(0, 1fr);
  }

  .cv__dot {
    width: 11px;
    height: 11px;
  }

  .cv__item:not(:last-child)::before {
    left: 5px;
  }

  /* Pinned at the top of the page, the chip strip is pushed down by its own
     `top: 68px` and so covers the first 68px of the deck stream below it. */
  .wrk__decks > :first-child .cat__head {
    padding-top: calc(68px + clamp(1.5rem, 4vh, 2.5rem));
  }
}

@media (max-width: 640px) {
  .wnav__back {
    font-size: 0.95rem;
  }

  .deck__frame--mobile {
    max-width: 250px;
  }

  .cat__title {
    font-size: 1.05rem;
  }

  .cat__count {
    font-size: 0.6rem;
  }

  .deck__actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .wrk__outro-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  body.wrk-js .wrk-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .wnav__back-arrow,
  .deck__glow {
    transition: none;
  }
}
