/* ─── tokens ──────────────────────────────────────────────── */
:root {
  --bg:           #80878c;
  --backdrop:     #2a3746;   /* dark sky behind the framed composition */
  --frame:        #d6e2ee;   /* lightest blue framing the composition */
  --frame-pad:    32px;      /* gap where the starfield shows around the frame */
  --strip-bg:     #626c74;
  --ink:          #20293a;
  --ink-soft:     rgba(32, 41, 58, 0.82);
  --ink-muted:    rgba(32, 41, 58, 0.48);
  --ink-faint:    rgba(32, 41, 58, 0.11);
  --pink:         #c07878;
  --pink-deep:    #a85f5f;
  --frosted:      rgba(245, 247, 252, 0.94);
  --strip-w:      100px;
  --header-h:     90px;
  --heading-h:    90px;
  --sans:         "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono:         "IBM Plex Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
}

/* ─── reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* dark starry sky sits behind the framed composition */
body {
  background: var(--backdrop);
  padding: var(--frame-pad);
}

/* starfield canvas — injected by script, painted behind the frame */
#starfield {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ─── shell ───────────────────────────────────────────────── */
/* the whole app lives inside a light-blue frame; stars show in the gap */
#shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 5px solid var(--frame);
  box-shadow:
    inset 0 0 0 1px #000,
    0 0 0 1px #000;
}

/* ─── header ──────────────────────────────────────────────── */
#site-header {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 20px 0 calc(var(--strip-w) + 20px);
  background: var(--strip-bg);
  border-bottom: 1px solid var(--ink-faint);
  gap: 0;
}

.site-name {
  font-family: var(--sans);
  font-size: 4.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.strike-zero {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.site-sub {
  font-family: var(--mono);
  font-size: 1.575rem;
  color: var(--ink);
  margin-left: 16px;
  letter-spacing: 0.04em;
  align-self: flex-end;
  padding-bottom: 12px;
}

/* ─── workspace ───────────────────────────────────────────── */
#workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}


/* ─── strip ───────────────────────────────────────────────── */
#strip {
  width: var(--strip-w);
  flex-shrink: 0;
  background: var(--strip-bg);
  border-right: 1px solid var(--ink-faint);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: none;
}
#strip::-webkit-scrollbar { display: none; }

/* ─── thumbnail button ────────────────────────────────────── */
.thumb-btn {
  position: relative;
  width: var(--strip-w);
  height: 112px;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--strip-bg);
  border: none;
  padding: 0;
  border-left: 3px solid transparent;
  outline: none;
  transition: border-color 240ms ease-out;
}

.thumb-btn:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: -2px;
}

.thumb-btn img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* contact-sheet negative: desaturated, punchy contrast, dark */
  filter: saturate(0.18) contrast(1.3) brightness(0.6);
  transition: filter 400ms ease-out;
  will-change: filter;
}

/* vignette overlay always present */
.thumb-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    155deg,
    rgba(32, 41, 58, 0.0) 30%,
    rgba(32, 41, 58, 0.55) 100%
  );
  pointer-events: none;
  z-index: 1;
  transition: opacity 240ms ease-out;
}

.thumb-btn:hover img {
  filter: saturate(0.55) contrast(1.08) brightness(0.82);
}

.thumb-btn:hover::after {
  opacity: 0.5;
}

.thumb-btn.active img {
  filter: saturate(1) contrast(1) brightness(1);
}

.thumb-btn.active::after {
  opacity: 0.3;
}

.thumb-btn.active {
  border-left-color: var(--pink);
}

/* index label */
.thumb-idx {
  position: absolute;
  bottom: 7px;
  left: 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: rgba(245, 247, 252, 0.65);
  z-index: 2;
  letter-spacing: 0.1em;
  transition: color 240ms ease-out;
  user-select: none;
}

.thumb-btn.active .thumb-idx {
  color: rgba(245, 247, 252, 0.9);
}

/* no-image placeholder */
.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink-muted);
  background: rgba(32, 41, 58, 0.08);
  letter-spacing: -0.02em;
}

/* ─── strip scroll-for-more hint ───────────────────────────── */
#strip-scroll-hint {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--strip-w);
  height: 56px;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 9px;
  background: linear-gradient(to bottom, rgba(98, 108, 116, 0) 0%, var(--strip-bg) 76%);
  opacity: 0;
  transition: opacity 260ms ease-out;
}

#strip-scroll-hint.visible { opacity: 1; }

#strip-scroll-hint svg {
  width: 20px;
  height: 20px;
  color: rgba(245, 247, 252, 0.7);
  animation: strip-hint-bounce 1.7s ease-in-out infinite;
}

@keyframes strip-hint-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ─── floating tooltip ─────────────────────────────────────── */
#strip-tip {
  position: fixed;
  left: calc(var(--strip-w) + 7px);
  background: var(--strip-bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 130ms ease-out;
  z-index: 300;
  box-shadow: 3px 3px 10px rgba(32, 41, 58, 0.16);
  transform: translateY(-50%);
}

#strip-tip.visible { opacity: 1; }

/* ─── stage ────────────────────────────────────────────────── */
#stage {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-muted) transparent;
}

#stage::-webkit-scrollbar { width: 5px; }
#stage::-webkit-scrollbar-thumb {
  background: var(--ink-muted);
  border-radius: 3px;
}
#stage::-webkit-scrollbar-track { background: transparent; }

/* ─── project heading bar (full-width, between header and workspace) */
#project-heading {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  background: rgba(245, 247, 252, 0.07);
  border-bottom: 1px solid var(--ink-faint);
}

/* mirrors the strip width so content aligns with stage below */
.heading-strip-gap {
  width: var(--strip-w);
  flex-shrink: 0;
  border-right: 1px solid var(--ink-faint);
}

/* description lives here */
.heading-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: 8px 20px 12px;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-style: normal;
  color: var(--ink);
  letter-spacing: 0.015em;
  line-height: 1.5;
}

/* project name + expand toggle — no isolated box */
.heading-info {
  width: 300px;
  flex-shrink: 0;
  padding: 12px 36px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.expand-toggle {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
  transition: color 150ms ease-out;
  outline: none;
}

.expand-toggle:hover { color: var(--pink); }

.expand-toggle:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── stage content ────────────────────────────────────────── */
.stage-inner {
  display: flex;
  align-items: flex-start;
  min-height: 100%;
}

/* transition states — applied via JS */
.stage-inner.is-exiting {
  transition: opacity 190ms ease-out, transform 190ms ease-out;
}
.stage-inner.is-entering {
  transition: opacity 230ms ease-out, transform 230ms ease-out;
}

/* ─── images column ────────────────────────────────────────── */
.images-col {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border-right: 1px solid var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 3px;
}

.project-image-frame {
  flex: 1 1 100%;            /* landscape shots span the column */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--strip-bg);
}

/* portrait (phone) shots sit side by side to save vertical space */
.project-image-frame.is-portrait {
  flex: 1 1 300px;
  max-width: calc(50% - 2px);
}

.project-image-frame img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  display: block;
}

.project-image-frame.is-portrait img {
  max-height: 82vh;
}

/* no-images placeholder */
.no-images {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
}

/* ─── info sidebar ─────────────────────────────────────────── */
.info-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 20px 36px 48px;
  position: sticky;
  top: 0;
  max-height: calc(100vh - var(--header-h) - var(--heading-h) - 2 * var(--frame-pad) - 10px);
  overflow-y: auto;
  scrollbar-width: none;
  background: rgba(245, 247, 252, 0.07);
}
.info-sidebar::-webkit-scrollbar { display: none; }

/* ─── project header ───────────────────────────────────────── */
.project-header {
  margin-bottom: 24px;
}

.project-name {
  font-family: var(--sans);
  font-size: clamp(1.29rem, 2.07vw, 1.76rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}

.project-tagline {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.015em;
  font-style: italic;
  line-height: 1.5;
}

/* ─── blurb ────────────────────────────────────────────────── */
.project-blurb {
  font-size: 0.9375rem;
  line-height: 1.72;
  color: var(--ink);
  text-wrap: pretty;
  margin-bottom: 32px;
}

/* ─── content frame (collapsed by default, expands on .expanded) */
.project-content-frame {
  border-radius: 3px;
  border: 0px solid var(--pink);
  padding: 0 20px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 440ms ease-out,
    opacity    270ms ease-out,
    padding    310ms ease-out,
    border-width 310ms ease-out,
    margin-top 310ms ease-out;
}

/* expanded — Monkeytype Rouge theme: coral surface, white text */
.info-sidebar.expanded .project-content-frame {
  border-width: 2px;
  border-color: #ffffff;
  padding: 20px;
  margin-top: 4px;
  max-height: 2600px;
  opacity: 1;
  background: #C25E5E;
  color: #ffffff;
  font-family: "Roboto Mono", var(--mono);
}

.info-sidebar.expanded .project-blurb {
  font-family: "Roboto Mono", var(--mono);
  font-size: 0.8125rem;
  line-height: 1.72;
  color: #ffffff;
  margin-bottom: 28px;
}

.info-sidebar.expanded .project-blurb:last-child {
  margin-bottom: 0;
}

.info-sidebar.expanded .recipe {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.info-sidebar.expanded .recipe-label {
  color: #ffffff;
}

.info-sidebar.expanded .recipe-chevron {
  color: #ffffff;
}

.info-sidebar.expanded .recipe summary:hover .recipe-label,
.info-sidebar.expanded .recipe summary:hover .recipe-chevron {
  color: rgba(255, 255, 255, 0.72);
}

.info-sidebar.expanded .recipe-body {
  background: #AB4A4A;
  border-color: rgba(255, 255, 255, 0.15);
}

.info-sidebar.expanded .recipe-section-label {
  color: rgba(255, 255, 255, 0.65);
}

.info-sidebar.expanded .recipe-section-body,
.info-sidebar.expanded .recipe-list {
  color: #ffffff;
}

.info-sidebar.expanded .recipe-list li::marker {
  color: #ffffff;
}

/* ─── recipe ───────────────────────────────────────────────── */
.recipe {
  border-top: 1px solid var(--ink-faint);
  padding-top: 24px;
}

.recipe summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
  padding: 2px 0;
}
.recipe summary::-webkit-details-marker { display: none; }

.recipe-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--pink);
  text-transform: uppercase;
  transition: color 150ms ease-out;
}

.recipe-chevron {
  color: var(--pink);
  flex-shrink: 0;
  transition: transform 230ms ease-out, color 150ms ease-out;
  display: block;
}

.recipe[open] .recipe-chevron {
  transform: rotate(180deg);
}

.recipe summary:hover .recipe-label,
.recipe summary:hover .recipe-chevron {
  color: var(--pink-deep);
}

.recipe-body {
  margin-top: 18px;
  padding: 20px 24px;
  background: var(--frosted);
  border-radius: 4px;
  border: 1px solid rgba(32, 41, 58, 0.07);
}

.recipe[open] .recipe-body {
  animation: recipe-open 230ms ease-out;
}

@keyframes recipe-open {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.recipe-section {
  margin-bottom: 18px;
}
.recipe-section:last-child { margin-bottom: 0; }

.recipe-section-label {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.recipe-section-body {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.72;
  color: var(--ink);
}

.recipe-list {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--ink);
  padding-left: 1.4em;
}

.recipe-list li::marker {
  color: var(--pink-deep);
}

/* ─── responsive ───────────────────────────────────────────── */

/* sidebar collapses below stage at medium width */
@media (max-width: 960px) {
  .stage-inner {
    flex-direction: column;
  }

  .images-col {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ink-faint);
  }

  .project-image-frame img {
    max-height: 70vh;
  }

  .info-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    padding: 20px 32px 48px;
    order: -1;
  }
}

/* strip → top rail at narrow width */
@media (max-width: 780px) {
  :root { --frame-pad: 14px; }

  #site-header {
    padding: 0 16px;
  }

  #workspace {
    flex-direction: column;
  }

  #strip {
    width: 100%;
    height: 76px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--ink-faint);
    gap: 1px;
  }

  .thumb-btn {
    width: 84px;
    height: 76px;
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .thumb-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--pink);
  }

  #strip-tip { display: none; }

  #strip-scroll-hint { display: none; }

  .heading-strip-gap { display: none; }

  .heading-left {
    padding: 8px 16px 12px;
  }

  .heading-info {
    width: auto;
    min-width: 180px;
    padding: 10px 16px 12px;
  }

  .info-sidebar {
    padding: 16px 20px 40px;
  }

  .project-image-frame img {
    max-height: 60vh;
  }
}

/* ─── reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .thumb-btn img,
  .thumb-btn::after,
  .thumb-btn,
  .recipe-chevron,
  #strip-tip {
    transition: none;
  }

  #strip-scroll-hint svg { animation: none; }

  .stage-inner.is-exiting,
  .stage-inner.is-entering {
    transition: opacity 80ms linear;
  }

  .recipe[open] .recipe-body {
    animation: none;
  }

  .project-content-frame {
    transition: opacity 80ms linear;
  }
}
