/* ------------------------------------------------
   Design tokens — jessicaprost.xyz color system
   ------------------------------------------------ */
:root {
  --background:        rgb(250, 248, 245);
  --foreground:        hsl(40, 8%, 11%);
  --card:              hsl(43, 28%, 93%);
  --accent:            hsl(43, 22%, 85%);
  --muted-foreground:  hsl(30, 5%, 45%);
  --border:            hsl(43, 18%, 84%);
  --faded:             hsl(43, 18%, 78%);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --nav-height: 72px;
  --page-padding-x: 40px;
  --page-padding-y: 32px;
}

/* ------------------------------------------------
   Base
   ------------------------------------------------ */
html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1rem;
  line-height: 1.5;
}

::selection {
  background-color: hsl(40, 8%, 11%, 0.15);
  color: var(--foreground);
}

/* ------------------------------------------------
   Nav — jessicaprost.xyz exact
   Fixed top, scroll-hide, name + pill buttons
   ------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--nav-height);
  padding: 0 var(--page-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--background);
  transform: translateY(0);
  transition: transform 300ms ease-in-out;
}

.site-nav.nav-hidden {
  transform: translateY(-100%);
}

.nav-name {
  font-size: 1rem;
  font-weight: 500;
  color: rgb(23, 28, 38);
  text-decoration: none;
  transition: opacity 150ms;
}

.nav-name:hover {
  opacity: 0.6;
}

/* Back arrow on project pages */
.nav-back {
  display: flex;
  align-items: center;
}

.nav-back-arrow {
  display: inline-block;
  transform: translateX(-8px);
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: transform 250ms ease, opacity 250ms ease, max-width 250ms ease, margin-right 250ms ease;
  margin-right: 0;
}

.nav-back:hover .nav-back-arrow {
  transform: translateX(0);
  opacity: 1;
  max-width: 20px;
  margin-right: 4px;
}

.nav-back:hover {
  opacity: 1;
}

.nav-pills {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-pill {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.28px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.4);
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  padding: 4px 12px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 300ms ease-out;
}

.nav-pill:hover {
  color: #000000;
  border-color: #000000;
}

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--foreground);
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
}

.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------
   Page layout
   ------------------------------------------------ */
.container {
  padding: calc(var(--nav-height) + 16px) var(--page-padding-x) var(--page-padding-y);
  min-height: 100vh;
}

.columns {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-top: 40px;
}

@media (min-width: 768px) {
  .columns {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 24px;
    align-items: start;
    min-height: calc(100vh - var(--nav-height) - 120px);
  }

  /* Left column: 5 of 12 */
  .columns .expandable-section {
    grid-column: 1 / span 5;
  }

  /* Right column: 6 of 12, flush right with 1-col gap from left */
  .columns .work-column {
    grid-column: 7 / span 6;
  }
}

/* ------------------------------------------------
   Expandable section — jacobheftmann.com exact
   Applied to the H1 in the left column
   ------------------------------------------------ */
.expandable-section {
  width: 100%;
}

/* Two-column grid: icon col | text col */
.trigger {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 12px;
  align-items: start;
}

.trigger-icon {
  padding-top: 6px; /* optically align number with cap height of H1 */
}

.trigger-body h1 {
  display: inline;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

/* Trigger icon */
.trigger-number {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  transition: transform 300ms ease;
  color: var(--foreground);
}

@keyframes spin-full {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.trigger-number.is-spinning {
  animation: spin-full 500ms ease;
}

/* Content — span stays inline (default) so it flows continuously from the H1,
   matching jacobheftmann.com where trigger and content share one text block */
.content {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: rgb(92, 99, 112);
  text-indent: 0;
  text-wrap: pretty;
}

/* Sub-content paragraphs are blocks that stack below the trigger container */
.sub-content {
  display: block;
  margin-top: 10px;
  padding-left: 38px;
}

/* Links within content (↓ and ↗ expand links) */
.expand-link {
  font-size: 1.25rem;
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  display: block;
  width: fit-content;
  margin-top: 24px;
}

.expand-link:hover {
  text-decoration: none;
}

/* Fade out previously-read paragraphs */
.is-old-paragraph {
  color: var(--faded) !important;
}

.is-old-paragraph .expand-link,
.is-old-paragraph .expand-link:hover {
  color: var(--faded) !important;
}

/* ------------------------------------------------
   Right column — selected work
   ------------------------------------------------ */
.work-column {
  display: flex;
  flex-direction: column;
}

.section-label {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background-color: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 100ms, box-shadow 100ms;
}

.project-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px hsl(40, 8%, 11%, 0.05),
              0 4px 6px -4px hsl(40, 8%, 11%, 0.05);
}

/* Image container */
.project-image-wrap {
  position: relative;
  overflow: hidden;
  height: 500px;
  width: 100%;
}

/* Frosted pill overlay — bottom-left of image */
.project-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  border-radius: 9999px;
  background-color: hsl(30, 100%, 99%, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--foreground);
  pointer-events: none;
  transition: background-color 200ms, color 200ms;
}

.project-row:hover .project-pill {
  background-color: #000000;
  color: #ffffff;
}

/* Image scales on hover — jessicaprost.xyz exact */
.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.project-row:hover .project-image {
  transform: scale(1.03);
}

/* Placeholder color fills for prototype */
.placeholder-1 { background: hsl(43, 28%, 88%); }
.placeholder-2 { background: hsl(200, 14%, 83%); }
.placeholder-3 { background: hsl(20, 18%, 84%); }

/* Project bottom bar */
.project-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}

.project-title {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--foreground);
  min-width: 0;
}

/* ------------------------------------------------
   Footer
   ------------------------------------------------ */
.site-footer {
  background-color: #F2F0E8;
  text-align: left;
  padding: 16px var(--page-padding-x);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Arrow — faint, slides right and brightens on card hover */
.project-arrow {
  color: var(--foreground);
  opacity: 0.3;
  flex-shrink: 0;
  transition: opacity 300ms, transform 300ms;
}

.project-row:hover .project-arrow {
  opacity: 0.7;
  transform: translateX(4px);
}

/* ------------------------------------------------
   Project page
   ------------------------------------------------ */
.ppage {
  padding-top: var(--nav-height);
  padding-bottom: 80px;
}

.ppage-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px var(--page-padding-x) 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  row-gap: 48px;
  align-items: start;
}

/* ── Left sidebar: cols 1–3 ── */
.ppage-sidebar {
  grid-column: 1 / span 3;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.ppage-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-wrap: pretty;
}

.ppage-pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px 10px;
  color: var(--muted-foreground);
  width: fit-content;
}

.ppage-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ppage-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ppage-meta-label {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.ppage-meta-value {
  font-size: 0.875rem;
  color: rgb(92, 99, 112);
  line-height: 1.5;
}

/* ── Scrollable right content: cols 7–13 ── */
.ppage-content {
  grid-column: 7 / span 7;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.ppage-section-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-wrap: pretty;
}

.ppage-text-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ppage-text-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ppage-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--foreground);
  font-weight: 400;
}

.ppage-stat {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.7;
  padding-top: 20px;
  color: var(--foreground);
  list-style: disc;
  margin-left: 1.25em;
}

.ppage-stat + .ppage-stat {
  padding-top: 0;
}

.ppage-list {
  list-style: disc;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ppage-list li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--foreground);
}

/* Split: text left, image right */
.ppage-split {
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  column-gap: 40px;
  align-items: end;
}

.ppage-split-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ppage-split-image {
  border-radius: 16px;
  max-height: calc((100vh - var(--nav-height) - 80px) * 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ppage-split-image img,
.ppage-split-image video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc((100vh - var(--nav-height) - 80px) * 0.7);
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Showcase images */
.ppage-showcase {
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--card);
}

.ppage-hero {
  height: 700px;
}

.ppage-full-span {
  grid-column: 1 / -1;
}

.ppage-showcase-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Side-by-side showcases */
.ppage-showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 2x2 showcase grid */
.ppage-showcase-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Showcase click cursor */
.ppage-showcase:not(.ppage-hero) {
  cursor: zoom-in;
}

/* ------------------------------------------------
   Lightbox
   ------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lightbox-in 200ms ease;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: color 150ms;
  z-index: 101;
}

.lightbox-close:hover {
  color: #ffffff;
}

.lightbox-media-wrap {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
}

.lightbox-media-wrap img,
.lightbox-media-wrap video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

/* Next project */
.ppage-next-wrap {
  border-top: 1px solid var(--border);
  padding-top: 0;
}

.ppage-next {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 40px 0 48px;
  text-decoration: none;
  color: inherit;
  transition: opacity 150ms;
}

.ppage-next:hover {
  opacity: 0.6;
}

.ppage-next-label {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ppage-next-title {
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

@media (max-width: 767px) {
  :root {
    --page-padding-x: 16px;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-pills {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--background);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 16px 24px;
    gap: 8px;
    border-top: 1px solid var(--border);
    z-index: 39;
  }

  .nav-pills.is-open {
    display: flex;
  }

  .ppage-sidebar {
    display: none;
  }

  /* Collapse the 12-col grid to a single column on mobile */
  .ppage-inner {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .ppage-full-span,
  .ppage-content {
    grid-column: 1 / -1;
  }

  /* Reduce hero height to something sane on a phone */
  .ppage-hero {
    height: min(480px, 62vw);
  }
}
