/* =========================================================
   artoflah portfolio — styles.css
   design tokens + base layout + project module
   ========================================================= */

@font-face {
  font-family: 'Display';
  src: url('assets/fonts/display.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #fafaf7;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #ff6fa3;
  --accent-soft: #ffd6e4;
  --sticker-yellow: #f8ea23;
  --sticker-blue: #6fd7ff;
  --sticker-orange: #ff9b45;
  --sticker-green: #a8f06a;
  --sticker-silver: #e6e3dc;
  --border: rgba(0, 0, 0, 0.08);

  --font-display: 'Display', 'Times New Roman', serif;
  --font-body: 'Display', 'Instrument Sans', system-ui, -apple-system, sans-serif;

  --sidebar-w: 390px;
  --gutter: 36px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}

/* hide native cursor sitewide — custom cursor takes over on desktop */
@media (hover: hover) and (pointer: fine) {
  html, body, * { cursor: none; }
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s, color 0.15s; }
a:hover { border-bottom-color: var(--accent); color: var(--accent); }

ul, ol { list-style: none; }

/* =========================================================
   LAYOUT
   ========================================================= */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1100px);
  grid-template-rows: auto 1fr;
  column-gap: var(--gutter);
  row-gap: 24px;
  width: 100%;
  padding: 48px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
  justify-content: center;
}
.layout > .logo    { grid-column: 1; grid-row: 1; }
.layout > .sidebar { grid-column: 1; grid-row: 2; }
.layout > .projects { grid-column: 2; grid-row: 1 / span 2; }

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  position: fixed;
  top: 48px;
  left: max(48px, calc((100vw - 1600px) / 2 + 48px));
  width: var(--sidebar-w);
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 24px;
  padding: 0;
  border-right: none;
  border-radius: 0;
  max-height: none;
  overflow: visible;
  font-size: 15px;
  line-height: 1.08;
}

.logo {
  display: flex;
  align-items: center;
  height: 56px;
  border-bottom: none;
}
.logo img { width: 40px; height: 40px; display: block; }
.logo:hover { border-bottom: none; }

.sidebar-poster {
  position: relative;
  min-height: 660px;
  padding-top: 16px;
}

.sidebar-help {
  position: absolute;
  top: 134px;
  left: 8px;
  z-index: 3;
  width: 238px;
  margin-left: 0;
  color: rgba(10, 10, 10, 0.48);
  font-size: 18px;
  line-height: 1.06;
  text-align: left;
  transform: rotate(-4deg);
  transform-origin: 65% 20%;
}

.sidebar-portrait {
  position: absolute;
  left: -102px;
  top: 256px;
  z-index: 1;
  width: 285px;
  margin: 0;
  overflow: visible;
  background: transparent;
}

.sidebar-portrait img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 1;
}

.sidebar-ladybug {
  position: absolute;
  left: 130px;
  top: 540px;
  z-index: 4;
  width: 70px;
  height: 70px;
  transform: rotate(9deg);
  pointer-events: none;
}

.contact {
  margin-left: 64px;
}

.bio p {
  margin-bottom: 0.85em;
  font-size: 18px;
  line-height: 1.08;
}

.meta-label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--fg);
  margin-bottom: 22px;
  text-decoration: none;
}

.meta-list li {
  font-size: 18px;
  line-height: 1.02;
}

.contact p {
  font-size: 15px;
  line-height: 1.12;
}

.contact a {
  border-bottom-color: transparent;
}

.sidebar a {
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.55), rgba(248, 234, 35, 0.72), rgba(111, 215, 255, 0.55));
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 0 42%;
  transition: background-size 0.18s ease, color 0.15s ease;
}

.sidebar a:hover {
  border-bottom-color: transparent;
  color: var(--fg);
  background-size: 100% 42%;
}

.now-playing {
  padding-top: 0;
  border-top: none;
  margin-left: 64px;
}
.np-track {
  font-size: 15px;
  line-height: 1.05;
  color: var(--muted);
  font-style: italic;
}
.np-track .np-title { color: var(--fg); font-style: normal; }

/* =========================================================
   PROJECTS
   ========================================================= */

.sticker-nav {
  position: sticky;
  top: 18px;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 86px;
  margin-bottom: 6px;
  pointer-events: none;
}

.loose-sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 7px 22px 5px;
  border: none;
  background: var(--accent-soft);
  color: var(--fg);
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: none;
  pointer-events: auto;
}

.loose-sticker:hover {
  color: var(--fg);
  border-bottom: none;
  transform: rotate(0deg) scale(1.04);
}

.sticker-extras {
  margin: 34px 0 0 -12px;
  transform: rotate(2deg);
}

.sticker-about {
  margin: 0 10px 0 0;
  transform: rotate(-6deg);
}

.sticker-pink { background: var(--accent-soft); }
.sticker-blue { background: var(--sticker-blue); }
.sticker-orange { background: var(--sticker-orange); }
.sticker-green { background: var(--sticker-green); }
.sticker-yellow { background: var(--sticker-yellow); }
.sticker-silver { background: var(--sticker-silver); }

.projects {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 240px;
  width: 100%;
  min-width: 0;
}
.project + .project { margin-top: 10px; }

.project {
  position: relative;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.project-head {
  margin: -42px auto 104px;
  order: 2;
  width: 100%;
  max-width: 640px;
  text-align: center;
  align-self: center;
  position: relative;
  z-index: 20;
}
.stage { order: 1; }

.project-index {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.project-meta {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.4;
  color: var(--fg);
  margin: 0;
  max-width: 960px;
}

.project-summary {
  max-width: 760px;
  font-family: var(--font-body);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.18;
  color: var(--fg);
}

.project-caption {
  display: inline;
  border-bottom-color: transparent;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.18;
  color: var(--fg);
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.45), rgba(248, 234, 35, 0.7), rgba(111, 215, 255, 0.45));
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 0 38%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 0.18s ease, color 0.15s ease;
}

.project-caption:hover {
  color: var(--fg);
  border-bottom-color: transparent;
  background-size: 100% 38%;
}

.project-year {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.18;
  color: var(--fg);
}

.project-title a,
.detail-media-link {
  border-bottom: none;
}

.project-title a:hover {
  color: var(--accent);
  border-bottom: none;
}

.detail-media-link {
  display: block;
  pointer-events: auto;
}

.detail-media-link:hover {
  color: inherit;
  border-bottom: none;
}
.project-meta > div {
  display: inline;
}
.project-meta dt {
  display: inline;
  font-size: 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: super;
  color: var(--fg);
  margin-right: 0.25em;
  font-weight: 400;
}
.project-meta dt::before { content: '('; }
.project-meta dt::after { content: ')'; }
.project-meta dd {
  display: inline;
  margin: 0;
  margin-right: 0.6em;
}

.project-description {
  font-family: var(--font-body);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.4;
  color: var(--fg);
  margin-top: 48px;
  max-width: 960px;
}

.misc-project {
  min-height: 0;
}

.misc-placeholder {
  max-width: 960px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   MISCELLANEOUS INDEX
   ========================================================= */

.misc-index {
  height: 100vh;
  padding: 18px 0 24px 22px;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

.misc-topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}

.misc-topnav a {
  pointer-events: auto;
  border-bottom: none;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.misc-topnav img {
  display: block;
  width: 34px;
  height: 34px;
}

.misc-list {
  display: flex;
  flex-direction: row;
  gap: 0;
  height: calc(100vh - 82px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 12vw 22px 0;
  cursor: ew-resize;
}

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

.misc-entry {
  flex: 0 0 min(280px, 72vw);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  min-height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
}

.misc-media {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  max-height: 58vh;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 8px;
}

.misc-media::-webkit-scrollbar { display: none; }

.misc-media img,
.misc-media video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 24vh;
  object-fit: contain;
}

.misc-media img:nth-child(2n) {
  max-height: 20vh;
  margin-left: 0;
}

.misc-media img:nth-child(3n),
.misc-media video:nth-child(3n) {
  max-height: 18vh;
  margin-left: 0;
}

.misc-entry h1 {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.55vw, 22px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.misc-info {
  width: 100%;
  padding-bottom: 18px;
}

.misc-info > * {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 5px 1px;
  background: transparent;
  color: var(--fg);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.08;
  overflow-wrap: break-word;
}

.misc-kind {
  background: transparent;
  color: var(--fg);
}

.misc-year {
  background: transparent;
  color: var(--fg);
}

.misc-info p:not(.misc-kind):not(.misc-year) {
  background: transparent;
  color: var(--fg);
}

.misc-learn {
  border-bottom: none;
  background: rgba(255, 111, 163, 0.46);
  color: var(--fg);
}

.misc-learn:hover {
  color: var(--fg);
  border-bottom: none;
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.75), rgba(248, 234, 35, 0.68), rgba(111, 215, 255, 0.48));
}

.misc-bottom {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.misc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
  padding-top: 28px;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1;
  pointer-events: auto;
}

.misc-footer a {
  border-bottom-color: currentColor;
}

/* =========================================================
   PROJECT DETAIL PAGES
   ========================================================= */

.detail-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

.detail-nav {
  position: fixed;
  top: 18px;
  left: 22px;
  right: 22px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  pointer-events: none;
}

.detail-nav a {
  pointer-events: auto;
  border-bottom: none;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}

.detail-nav a:first-child { justify-self: start; }
.detail-next { justify-self: center; }
.detail-nav a:last-child { justify-self: end; }

.detail-next:hover {
  color: var(--fg);
  border-bottom-color: transparent;
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.55), rgba(248, 234, 35, 0.72), rgba(111, 215, 255, 0.55));
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 100% 42%;
}

.detail-nav img {
  display: block;
  width: 34px;
  height: 34px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 430px);
  gap: 42px;
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
  padding: 86px 48px 48px;
}

.detail-images {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.detail-images img,
.detail-images video {
  display: block;
  width: min(100%, 820px);
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  margin: 0 auto;
}

.detail-image-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 92%;
  margin: 0 auto;
}

.detail-copy {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 4px;
}

.detail-copy::-webkit-scrollbar {
  display: none;
}

.detail-index {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.detail-title {
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: clamp(42px, 4vw, 70px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.detail-meta {
  margin-bottom: 28px;
  font-size: 18px;
  line-height: 1.2;
}

.detail-meta p + p {
  margin-top: 4px;
}

.detail-copy h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.detail-copy p {
  font-size: 20px;
  line-height: 1.26;
}

.detail-copy p + p {
  margin-top: 16px;
}

.detail-copy a {
  border-bottom-color: currentColor;
}

.detail-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.detail-facts div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.detail-facts dt {
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-facts dd {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
}

.detail-facts dd p {
  font-size: inherit;
  line-height: inherit;
}

.detail-facts dd p + p {
  margin-top: 14px;
}

/* =========================================================
   ABOUT
   ========================================================= */

.about-page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 760px);
  column-gap: var(--gutter);
  min-height: 100vh;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 48px;
  background: var(--bg);
  color: var(--fg);
  align-items: start;
  justify-content: center;
}

.about-copy a:hover {
  color: var(--fg);
  border-bottom-color: transparent;
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.55), rgba(248, 234, 35, 0.72), rgba(111, 215, 255, 0.55));
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 100% 42%;
}

.about-copy {
  grid-column: 2;
  padding-top: 10vh;
}

.about-local-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 34px;
}

.about-local-nav a {
  display: inline-block;
  padding: 5px 12px 4px;
  border-bottom: none;
  background: var(--accent-soft);
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.about-local-nav a:nth-child(2) {
  transform: rotate(2deg);
}

.about-local-nav a:hover {
  color: var(--fg);
  border-bottom: none;
  background-image: linear-gradient(90deg, rgba(255, 111, 163, 0.55), rgba(248, 234, 35, 0.72), rgba(111, 215, 255, 0.55));
}

.about-copy h1 {
  margin-bottom: 28px;
  font-size: clamp(48px, 7vw, 110px);
  font-weight: 400;
  line-height: 0.9;
}

.about-copy h2 {
  margin: 46px 0 14px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.about-copy p {
  max-width: 720px;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.2;
}

.about-copy p + p {
  margin-top: 18px;
}

.about-skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  max-width: 720px;
  list-style: none;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.14;
}

.about-skill-list li::before {
  content: "/";
  margin-right: 8px;
  color: var(--accent);
}

/* =========================================================
   STAGE — hero + satellites
   ========================================================= */

.stage {
  position: relative;
  width: 100%;
  max-width: 1100px;
  min-height: 700px;
  margin: 16px auto 0;
}
.stage.stage-flat { min-height: auto; }

.hero {
  position: relative;
  z-index: 10;
  width: min(960px, 90%);
  margin: 40px auto;
  pointer-events: none;
}
.hero img,
.hero video { width: 100%; height: auto; display: block; }

.detail-media-link img,
.detail-media-link video,
.detail-media-link.browser-frame {
  transition: transform 0.18s ease;
}

/* on desktop, the carousel wrapper is an invisible positioned layer that
   fills the stage so satellites still use --x/--y relative to the stage */
.satellite-carousel {
  position: absolute;
  inset: 0;
  pointer-events: none; /* let clicks fall through to stage */
}
.satellite-carousel > * { pointer-events: all; }

/* =========================================================
   SATELLITES
   ========================================================= */

.satellite {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: rotate(var(--r, 0deg));
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  transition: filter 0.2s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}
.draggable-art {
  pointer-events: auto !important;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.satellite:not([style*="max-width"]) {
  max-width: 200px;
}

.satellite.is-dragging,
.draggable-art.is-dragging {
  transition: none !important;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
  z-index: 99;
}

.satellite.is-lifted {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s;
}

/* motion-graphic special satellite */
.satellite-motion {
  position: absolute;
  max-width: 220px;
}
.satellite-motion img { display: block; width: 100%; height: auto; }
.satellite-motion .motion-playing {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
}
.satellite-motion:hover .motion-playing { opacity: 1; }
.satellite-motion:hover .satellite-play-hint { opacity: 0; }

/* small "▶ play" label on the motion still — fades on hover */
.satellite-play-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.25s;
  line-height: 1;
}

/* =========================================================
   HERO MODAL
   ========================================================= */

#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 247, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.25s;
}
#modal-overlay[hidden] { display: none; }
#modal-overlay.is-open {
  display: flex;
  opacity: 1;
}
#modal-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: width 0.15s, height 0.15s, opacity 0.15s;
}
/* default state: show the ladybug <img> (SVG with embedded PNG — needs img tag, not bg-image) */
#cursor-ladybug { display: block; width: 100%; height: 100%; }
#cursor.state-grab #cursor-ladybug,
#cursor.state-grabbing #cursor-ladybug,
#cursor.state-play #cursor-ladybug { display: none; }
/* state cursors are clean vectors — background-image works fine */
#cursor.state-grab { background-image: url('assets/cursors/grab.svg'); width: 32px; height: 32px; }
#cursor.state-grabbing { background-image: url('assets/cursors/grab-active.svg'); width: 32px; height: 32px; }
#cursor.state-play { background-image: url('assets/cursors/play.svg'); width: 36px; height: 36px; }

/* touch devices: no custom cursor */
@media (hover: none) or (pointer: coarse) {
  #cursor { display: none; }
  html, body, * { cursor: auto; }
}

/* =========================================================
   DEVICE FRAMES — browser + phone
   ========================================================= */

.device-showcase {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  width: min(960px, 90%);
  margin: 40px auto;
}

.device-showcase-under {
  margin-top: 0;
}

.browser-frame {
  display: block;
  border: 1px solid var(--fg);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  width: 100%;
  max-width: 720px;
  flex: 1 1 520px;
}
.browser-frame-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fg);
  background: var(--bg);
}
.browser-frame-dots {
  display: flex;
  gap: 5px;
}
.browser-frame-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.15;
  display: block;
}
.browser-frame-url {
  flex: 1;
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.browser-frame-body {
  display: block;
  background: #0a0a0a;
  line-height: 0;
}
.browser-frame-body img,
.browser-frame-body video {
  display: block;
  width: 100%;
  height: auto;
}

.phone-frame {
  display: block;
  border: 1px solid var(--fg);
  border-radius: 22px;
  padding: 8px 7px;
  background: var(--bg);
  width: 148px;
  flex: 0 0 148px;
}
.phone-frame-speaker {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.phone-frame-speaker span {
  display: block;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: var(--fg);
  opacity: 0.2;
}
.phone-frame-body {
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0a;
  aspect-ratio: 9 / 19;
  line-height: 0;
}
.phone-frame-body img,
.phone-frame-body video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* hero with browser-frame inside — prevent .hero img rule from interfering */
.hero .browser-frame-body img,
.hero .browser-frame-body video { width: 100%; height: auto; }
.hero .phone-frame-body img,
.hero .phone-frame-body video { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {
  html, body { overflow-x: clip; }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px;
    width: 100%;
    padding: 0;
    margin: 24px 0 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  .layout > .logo    { grid-column: 1; grid-row: 1; }
  .layout > .sidebar { grid-column: 1; grid-row: 2; min-width: 0; }
  .layout > .projects { grid-column: 1; grid-row: 3; min-width: 0; }
  .sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: hidden;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--fg);
    border-radius: 0;
  }
  .logo {
    display: none;
  }
  .sidebar * { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
  .sidebar-poster {
    min-height: 860px;
    padding-top: 0;
  }
  .sidebar-help {
    top: 28px;
    right: -4px;
    width: 83%;
    font-size: clamp(28px, 6.5vw, 38px);
  }
  .sidebar-portrait {
    top: 336px;
    width: 72%;
    aspect-ratio: 1 / 1.14;
  }
  .sidebar-ladybug {
    top: 650px;
    right: 20%;
    width: 76px;
    height: 76px;
  }
  .contact {
    margin-left: 64px;
  }
  .bio p,
  .meta-list li,
  .contact p,
  .np-track { font-size: 24px; }
  .sticker-nav {
    position: relative;
    top: auto;
    min-height: 68px;
    margin-bottom: 24px;
  }
  .loose-sticker {
    font-size: 22px;
    min-height: 34px;
    padding: 6px 16px 4px;
  }
  .sticker-extras { margin: 22px 0 0 0; }
  .sticker-about { margin: 0; }
  .projects { gap: 0; padding-bottom: 120px; }
  .project + .project { margin-top: 96px; }

  .project-head, .project-title, .project-meta { overflow-wrap: break-word; word-break: break-word; max-width: 100%; }
  .project-title { font-size: clamp(28px, 9vw, 48px); }
  .project-meta { font-size: clamp(16px, 4vw, 22px); }

  /* on mobile: hero full-width, satellites in a horizontal scroll carousel below */
  .stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 16px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .hero {
    position: static;
    width: 100%;
    margin: 0;
  }
  .satellite-carousel {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    overflow-x: clip;
    scroll-snap-type: none;
    padding-bottom: 8px;
  }
  .satellite-carousel::-webkit-scrollbar { height: 0; }
  .satellite-carousel { scrollbar-width: none; }
  .satellite {
    position: static;
    transform: none !important;
    flex: 0 0 auto;
    scroll-snap-align: start;
    max-width: 140px;
  }
  .satellite-motion {
    position: static;
    flex: 0 0 auto;
    scroll-snap-align: start;
    max-width: 180px;
  }

  /* project 01 has satellites directly in .stage (no carousel wrapper) —
     hide them on mobile since they're absolutely positioned and won't reflow */
  .stage > .satellite,
  .stage > .satellite-motion { display: none; }

  .misc-index {
    padding: 18px 0 28px 14px;
  }
  .misc-list {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: calc(100vh - 92px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 24px 18vw 22px 0;
  }
  .misc-list::-webkit-scrollbar { display: none; }
  .misc-entry {
    flex: 0 0 78vw;
    display: flex;
    justify-content: flex-start;
    padding-bottom: 28px;
  }
  .misc-media {
    margin-bottom: 12px;
    min-height: 44vh;
    max-height: 54vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .misc-media::-webkit-scrollbar { display: none; }
  .misc-media img,
  .misc-media video {
    max-width: 72vw;
    max-height: 30vh;
  }
  .misc-entry h1 {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .misc-year {
    margin-bottom: 6px;
  }
  .misc-footer {
    justify-content: flex-start;
  }

  .misc-bottom {
    left: 14px;
    right: 14px;
    bottom: 14px;
    align-items: flex-end;
  }

  .misc-topnav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .detail-nav {
    position: static;
    padding: 18px 14px 0;
  }
  .detail-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 14px 36px;
  }
  .detail-images {
    order: 2;
  }
  .detail-copy {
    position: static;
    order: 1;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .detail-image-row {
    grid-template-columns: 1fr;
  }
  .detail-copy p {
    font-size: 18px;
  }

  .about-page {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding: 18px 14px 36px;
  }

  .about-side {
    position: static;
    gap: 18px;
  }

  .about-copy {
    padding-top: 0;
  }

  .about-copy p {
    font-size: 18px;
  }
}
