/* =============================================================
   BRYAN RUIZ — PORTFOLIO
   Work Page Styles — Figma: "Work Page / Monarch" frames (1717:3459+)
   Design canvas: 1920px / 1638px content | Tech: Vanilla HTML/CSS/JS
   ============================================================= */

/* ---------------------------------------------------------------
   WORK PAGE WRAPPER
--------------------------------------------------------------- */
.work-page {
  padding-top: var(--nav-h);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-left: clamp(20px, 5vw, 82px);
  padding-right: clamp(20px, 5vw, 82px);
  padding-bottom: clamp(40px, 5vw, 82px);
}

/* ---------------------------------------------------------------
   BORDERED CONTAINER (3-column flex box)
   Design: 1619px wide, 695px tall, border-radius 24px
--------------------------------------------------------------- */
.work-container {
  max-width: 1619px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  display: flex;
  height: clamp(500px, 42.43vw, 695px);
  overflow: hidden;
}

/* ---------------------------------------------------------------
   LEFT SIDEBAR — Category Filters (aligned to BOTTOM)
   Design: 231px wide, categories at bottom, py-20px px-1px
--------------------------------------------------------------- */
.work-sidebar {
  width: clamp(140px, 14.1vw, 231px);
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 1px;
}

.work-category {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  opacity: 0.45;
  padding: clamp(8px, 0.73vw, 12px) clamp(12px, 1.22vw, 20px);
  transition: background-color 0.15s ease, opacity 0.2s ease;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.work-category:hover {
  opacity: 0.75;
}

.work-category--active {
  opacity: 1;
  background-color: #5e5e5e;
}

.work-category__icon {
  flex-shrink: 0;
  width: clamp(26px, 2.53vw, 41px);
  height: clamp(21px, 2.05vw, 33px);
  display: block;
  color: var(--color-white);
}

.work-category__label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(12px, 0.98vw, 16px);
  color: var(--color-white);
  letter-spacing: -0.05em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   PROJECT LIST — Middle column
   Design: 231px wide, list starts at top, py-20px px-1px
--------------------------------------------------------------- */
.work-list {
  width: clamp(140px, 14.1vw, 231px);
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  overflow-y: auto;
  padding: 20px 1px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  scrollbar-width: none;
}

.work-list::-webkit-scrollbar {
  display: none;
}

.work-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 0.73vw, 12px) clamp(12px, 1.22vw, 20px);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(12px, 0.98vw, 16px);
  color: var(--color-white);
  letter-spacing: -0.01em;
  transition: background-color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.work-list-item:hover:not(.work-list-item--active) {
  background-color: rgba(255, 255, 255, 0.05);
}

.work-list-item--active {
  background-color: #5e5e5e;
}

/* "Case Study" green pill tag (shown next to Hiro) */
.work-list-item__tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background-color: #56644e;
  border: 0.4px solid rgba(255, 255, 255, 0.8);
  border-radius: 99px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(10px, 0.73vw, 12px);
  color: var(--color-white);
  letter-spacing: -0.05em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   MAIN PREVIEW AREA — Right column
   Design: flex-grow, 40px gap, 40px h-padding, 10px v-padding
--------------------------------------------------------------- */
.work-preview {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 10px 40px;
}

/* ---------------------------------------------------------------
   PROJECT IMAGE
   Design: fills available width after info panel and padding
--------------------------------------------------------------- */
.work-img-wrap {
  flex: 1;
  min-width: 0;
  aspect-ratio: 824 / 452;
  border-radius: 20px;
  overflow: hidden;
}

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

/* ---------------------------------------------------------------
   CRAFTING PLACEHOLDER — intentional state, not an error
--------------------------------------------------------------- */
.work-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 3vw, 48px);
  padding: clamp(24px, 2.5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.work-placeholder__illustration {
  flex-shrink: 0;
  width: clamp(80px, 8vw, 120px);
  height: auto;
}

.work-placeholder__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(8px, 0.7vw, 12px);
  max-width: 320px;
}

.work-placeholder__heading {
  font-family: var(--font-heading);
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  letter-spacing: -0.02em;
}

.work-placeholder__text {
  font-family: var(--font-body);
  font-size: clamp(11px, 0.79vw, 13px);
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.75;
  margin: 0;
}

.work-placeholder__cta {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(4px, 0.4vw, 8px);
  font-family: var(--font-body);
  font-size: clamp(11px, 0.79vw, 13px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  padding: 6px 16px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.work-placeholder__cta:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.45);
}

/* ---------------------------------------------------------------
   PROJECT INFO PANEL
   Design: flex-1, 460px tall, space-between (text top, arrows bottom)
--------------------------------------------------------------- */
.work-info {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: clamp(260px, 28.1vw, 460px);
}

.work-info__top {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.34vw, 22px);
}

.work-info__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 36px);
  letter-spacing: -0.02em;
  color: #f1f1f1;
  line-height: 1;
}

.work-info__body {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(11px, 0.98vw, 16px);
  letter-spacing: -0.02em;
  color: #f1f1f1;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   CASE STUDY BUTTON — animated gradient pill (Figma node 1736:2824)
   Gradient: sage green (#758c69) → dark teal (#2b575e)
--------------------------------------------------------------- */
.work-info__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(120px, 9.03vw, 148px);
  padding: 10px;
  background: linear-gradient(78deg, #758c69, #2b575e, #758c69);
  background-size: 200% 100%;
  border: 0.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 99px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(13px, 0.98vw, 16px);
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  animation: cta-shimmer 3s ease-in-out infinite;
  transition: box-shadow 0.25s ease, filter 0.25s ease;
}

.work-info__cta:hover {
  box-shadow: 0 0 14px 2px rgba(43, 87, 94, 0.55);
  filter: brightness(1.15);
}

@keyframes cta-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------------------------------------------------------------
   PREV / NEXT NAVIGATION ARROWS
   Design: 44.338px diameter circles, diagonally staggered
   Back at top-left, Forward at bottom-right
--------------------------------------------------------------- */
.work-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.73vw, 12px);
  flex-shrink: 0;
}

.work-nav__btn {
  width: clamp(34px, 2.71vw, 44px);
  height: clamp(34px, 2.71vw, 44px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  color: var(--color-white);
}

.work-nav__btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}

.work-nav__btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.4);
}

.work-nav__btn svg {
  width: clamp(10px, 0.98vw, 16px);
  height: auto;
}

/* ---------------------------------------------------------------
   DUO — two portrait images side by side (e.g. mobile screens)
--------------------------------------------------------------- */
.work-duo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.2vw, 20px);
  padding: clamp(12px, 1.2vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.work-duo__img {
  flex: 1;
  height: 100%;
  max-width: 48%;
  border-radius: 12px;
  overflow: hidden;
}

.work-duo__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------------------------------------------------------------
   SCREENS — three phone screens side-by-side (Hiro slide 1)
   Images shown at full height, natural width — no cropping.
---------------------------------------------------------------- */
.work-screens {
  display: flex;
  gap: clamp(4px, 0.73vw, 12px);
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex: 1;
}

.work-screens__item {
  border-radius: clamp(6px, 0.73vw, 12px);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

/* Images fill the item height, width scales naturally — no cropping */
.work-screens__item img {
  display: block;
  height: 100%;
  width: auto;
}

/* All screens: same height, natural width */
.work-screens__item--lg,
.work-screens__item--md {
  height: 100%;
}

/* ---------------------------------------------------------------
   BENTO GRID — Slide 2 of Monarch
   Layout: 2 rows, top row 2 cols (29/71 split), bottom row 3 cols (41/28/31 split)
--------------------------------------------------------------- */
.work-bento {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.98vw, 16px);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.work-bento__row {
  display: flex;
  flex: 1;
  gap: clamp(8px, 0.98vw, 16px);
  min-height: 0;
}

.work-bento__img {
  border-radius: clamp(8px, 0.73vw, 12px);
  overflow: hidden;
  min-width: 0;
}

.work-bento__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Row 1: narrow (230.5) + wide (568) */
.work-bento__row:first-child .work-bento__img--1 { flex: 230.5; }
.work-bento__row:first-child .work-bento__img--2 { flex: 568; }

/* Row 2: medium (322) + small (221.5) + small (245.5) */
.work-bento__row:last-child .work-bento__img--3 { flex: 322; }
.work-bento__row:last-child .work-bento__img--4 { flex: 221.5; }
.work-bento__row:last-child .work-bento__img--5 { flex: 245.5; }

/* ---------------------------------------------------------------
   USER PERSONA CARD — Slide 3 of Monarch
   Design: flex row, items-end (photo overflows top), border, content left
--------------------------------------------------------------- */
.work-persona {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  display: flex;
  align-items: flex-end;
  overflow: visible;
  padding: 0 0 0 clamp(16px, 2.44vw, 32px);
  gap: clamp(12px, 1.83vw, 30px);
}

/* Left: text content — fills remaining space, vertically centered */
.work-persona__content {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1.04vw, 17px);
  padding-bottom: clamp(12px, 1.83vw, 30px);
}

/* Right: photo wrapper — overflows card at the top so Lina's head is above the border */
.work-persona__photo-wrap {
  flex-shrink: 0;
  width: clamp(160px, 19.05vw, 312px);
  /* large top overflow so the head is clearly above the card border */
  height: calc(100% + clamp(50px, 4.3vw, 70px));
  position: relative;
}

/* Inner clip: only rounds the bottom-right corner (matches card corner).
   Top has NO border-radius so the overflowing head isn't cut. */
.work-persona__photo-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0 0 20px 0;
}

/* Photo fills the clip and anchors from the top so the face is always visible */
.work-persona__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.work-persona__tag {
  display: inline-flex;
  align-items: center;
  background: #76c981;
  color: #0c0c0c;
  border-radius: 99px;
  padding: 3px 14px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(10px, 0.85vw, 14px);
  white-space: nowrap;
  align-self: flex-start;
}

.work-persona__name {
  font-family: 'Times New Roman', Times, serif;
  color: #76c981;
  font-size: clamp(24px, 2.73vw, 45px);
  line-height: 1;
  margin: 0;
}

.work-persona__role {
  font-family: var(--font-heading);
  font-weight: 500;
  color: #f3f3f3;
  font-size: clamp(9px, 0.95vw, 15px);
  margin: 0;
}

.work-persona__quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  color: #f3f3f3;
  font-size: clamp(9px, 0.95vw, 15px);
  line-height: 1.5;
  margin: 0;
}

/* Objectives box — translucent green panel with stats */
.work-persona__objectives {
  background: rgba(137, 224, 145, 0.4);
  border-radius: clamp(8px, 0.82vw, 13px);
  padding: clamp(8px, 0.98vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.61vw, 10px);
}

.work-persona__objectives-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(9px, 0.73vw, 12px);
  color: #fff;
  margin: 0;
}

.work-persona__stats {
  display: flex;
  gap: clamp(4px, 0.5vw, 8px);
  align-items: flex-start;
}

.work-persona__stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.work-persona__stat-circle {
  position: relative;
  width: clamp(30px, 3.32vw, 54px);
  height: clamp(30px, 3.32vw, 54px);
}

/* Each image is wrapped in a div that carries the Figma inset values */
.work-persona__stat-img-wrap {
  position: absolute;
}

.work-persona__stat-img-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.work-persona__stat-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(6px, 0.6vw, 10px);
  color: #fff;
  letter-spacing: -0.01em;
}

.work-persona__stat-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(6px, 0.55vw, 9px);
  color: #fff;
  text-align: center;
  line-height: 1.3;
}

/* Last stat: audit readiness — separated by a left border */
.work-persona__stat--audit {
  border-left: 1px solid rgba(255, 255, 255, 0.8);
  padding-left: clamp(4px, 0.5vw, 8px);
  justify-content: center;
  gap: 6px;
}

.work-persona__stat--audit .work-persona__stat-label {
  text-align: left;
}

.work-persona__audit-icon {
  width: clamp(12px, 1vw, 16px);
  height: clamp(12px, 1vw, 16px);
  color: #fff;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   RESPONSIVE — Tablet (≤ 900px)
--------------------------------------------------------------- */
@media (max-width: 900px) {
  .work-page {
    padding-left: 16px;
    padding-right: 16px;
    align-items: flex-start;
    padding-top: calc(var(--nav-h) + 16px);
  }

  .work-container {
    flex-direction: column;
    height: auto;
    border-radius: 16px;
  }

  .work-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    padding: 12px;
    gap: 0;
  }

  .work-category {
    padding: 10px 14px;
  }

  .work-list {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    height: auto;
  }

  .work-list-item {
    width: auto;
    border-radius: 4px;
    padding: 6px 12px;
  }

  .work-preview {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
  }

  .work-img-wrap {
    width: 100%;
  }

  .work-info {
    width: 100%;
    height: auto;
    gap: 16px;
  }

  .work-info__top {
    gap: 14px;
  }

  .work-nav {
    margin-top: 8px;
  }
}

/* ---------------------------------------------------------------
   RESPONSIVE — Mobile (≤ 600px)
--------------------------------------------------------------- */
@media (max-width: 600px) {
  .work-sidebar {
    flex-wrap: wrap;
  }

  .work-category__icon {
    width: 28px;
  }

  .work-category__label {
    font-size: 13px;
  }
}
