/*
  Portfolio pages — Work and case studies.
  A wider canvas, big type and product stages. Loaded on pages with `wide: true`.
  Each case study sets its own colours: --accent, --stage, --tint.
*/

.page-wrap--wide {
  max-width: 1160px;
}

.page-wrap--wide .site-nav {
  margin-bottom: 48px;
}

/* ---- Small parts ---- */
.eyebrow {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, var(--faint));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f1ef;
  font-size: 0.8rem;
  font-weight: 500;
  color: #4a4a4a;
  white-space: nowrap;
}

.chip-live,
.chip-testing,
.chip-personal {
  padding-left: 10px;
}

.chip-live::before,
.chip-testing::before,
.chip-personal::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.chip-live { color: #17784a; background: #e7f4ec; }
.chip-testing { color: #8a5a00; background: #fbf0d9; }
.chip-personal { color: #5a5a5a; background: #f1f1ef; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent, #000);
}

/* ---- Device frames ---- */
.phone {
  padding: 3.4%;
  border-radius: 16% / 7.4%;
  background: #0c0c0d;
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px #2c2c2e;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12.8% / 5.9%;
}

/* A screen that isn't full height sits on the frame's black, letterboxed */
.phone.fit .screen {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1206 / 2622;
  border-radius: 12.8% / 5.9%;
  background: #111;
}

.phone.fit .screen img {
  border-radius: 0;
}

.window {
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.07);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  background: linear-gradient(#f7f6f4, #ebeae7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.window-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }

.window img {
  display: block;
  width: 100%;
  height: auto;
}

.shot {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Work page ---- */
.work2 {
  padding: 24px 0 24px;
}

.work2-hero {
  margin-bottom: 72px;
}

.work2-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.75rem, 6.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.work2-hero p {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
  color: var(--muted);
}

.work2-block {
  margin-bottom: 104px;
}

.work2-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.work2-head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.work2-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--faint);
  text-align: right;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 32px;
}

.proj {
  display: block;
  color: inherit;
  text-decoration: none;
}

.proj-media {
  overflow: hidden;
  border-radius: 22px;
  background: #f1f1ef;
  aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.proj-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.proj:hover .proj-media img {
  transform: scale(1.025);
}

.proj-info {
  padding: 22px 2px 0;
}

.proj-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.proj-title h3 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

.proj:hover .proj-title h3 {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.proj-title span {
  font-size: 0.9rem;
  color: var(--faint);
  white-space: nowrap;
}

.proj-info p {
  margin: 8px 0 16px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted);
}

.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 26px 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.tcard-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--faint);
}

.tcard .stat {
  margin-top: 6px;
  font-size: 2.4rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
}

.tcard .stat-label {
  margin: -2px 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.tcard h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.tcard p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.tcard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
}

.tcard-links a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.tcard-links a:hover {
  color: var(--text);
}

.mcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.mcard-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.mcard-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mcard:hover .mcard-media img {
  transform: scale(1.03);
}

.mcard-media.peek {
  position: relative;
  padding: 22px 22px 0;
  background: #1a1b26;
}

.mcard-media.peek img {
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 10px 10px 0 0;
}

.mcard-media.peek::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 45%;
  background: linear-gradient(rgba(26, 27, 38, 0), #1a1b26);
  pointer-events: none;
}

.mcard-media.contain {
  display: grid;
  place-items: center;
  padding: 22px;
  background: #1a1b26;
}

.mcard-media.contain img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}

.mcard-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 22px;
}

.mcard-body h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.mcard-body h3 small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0;
}

.mcard-body p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--muted);
}

.mcard-body .tcard-links {
  padding-top: 6px;
}

/* ---- Case study ---- */
.cs {
  --accent: var(--text);
  --stage: #f3f3f1;
  --tint: #f6f6f4;
  padding: 0 0 24px;
}

.cs-back {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.cs-back:hover {
  color: var(--text);
}

.cs-hero {
  margin-bottom: 48px;
}

.cs-hero h1 {
  margin: 0 0 22px;
  font-size: clamp(3rem, 8.4vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.cs-sub {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: #555;
}

.cs-cover {
  overflow: hidden;
  margin: 0 0 40px;
  border-radius: 28px;
  background: var(--stage);
}

.cs-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 128px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.cs-meta dt {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.cs-meta dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #222;
}

.cs-meta dd a {
  color: inherit;
}

.cs-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px;
  margin: 0 0 128px;
}

.cs-section.tight {
  margin-bottom: 48px;
}

.cs-section > header {
  position: sticky;
  top: 32px;
  align-self: start;
}

.cs-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cs-section h2 {
  margin: 12px 0 0;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.cs-text p {
  max-width: 680px;
  margin: 0 0 18px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #3e3e3e;
}

.cs-text p.cs-lead {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: #161616;
}

.cs-text p:last-child {
  margin-bottom: 0;
}

.cs-text code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--tint);
  font-size: 0.9em;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  margin: 0 0 128px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cs-stat {
  padding: 34px 24px 32px 0;
}

.cs-stat + .cs-stat {
  padding-left: 28px;
  border-left: 1px solid var(--border);
}

.cs-stat strong {
  display: block;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.cs-stat span {
  display: block;
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
}

.cs-showcase {
  margin: 0 0 128px;
}

.cs-stage {
  overflow: hidden;
  padding: clamp(28px, 6vw, 80px);
  border-radius: 28px;
  background: var(--stage);
}

.cs-stage.dark {
  background: var(--stage-dark, #111);
  color: #eee;
}

.cs-caption {
  margin: 16px 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--faint);
}

.cs-phones {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: clamp(16px, 3vw, 44px);
  align-items: start;
}

.cs-phones figure {
  margin: 0;
}

.cs-phones figcaption {
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
  color: var(--stage-ink, #6b6b6b);
}

.cs-phones .shot {
  border-radius: 18px;
}

.cs-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.bento {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 30px;
  border-radius: 24px;
  background: var(--tint);
}

.bento.span-2 { grid-column: span 2; }
.bento.span-3 { grid-column: span 3; }
.bento.span-4 { grid-column: span 4; }
.bento.span-6 { grid-column: span 6; }
.bento.rows-2 { grid-row: span 2; }

.bento h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.bento p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.bento-media {
  display: grid;
  flex: 1;
  place-items: center;
}

.bento-media img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.bento-media .phone {
  width: min(220px, 70%);
}

.cs-principles {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 20px;
}

.principle {
  padding: 28px 26px 30px;
  border-radius: 22px;
  background: var(--tint);
}

.principle .num {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.principle h3 {
  margin: 20px 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.principle p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #555;
}

.cs-quote {
  max-width: 920px;
  padding: 0;
  border: 0;
  color: var(--text);
  margin: 0 0 56px;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.cs-quote::before {
  content: "“";
  color: var(--accent);
}

.cs-quote::after {
  content: "”";
  color: var(--accent);
}

.cs-quote-cite {
  display: block;
  margin: -40px 0 56px;
  font-size: 0.95rem;
  color: var(--faint);
}

.cs-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.cs-tools span {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #444;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 26px;
}

.pills span {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-weight: 500;
  color: var(--text);
}

.pills.never span {
  background: transparent;
  box-shadow: 0 0 0 1px var(--border);
  color: var(--faint);
  text-decoration: line-through;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
}

.key {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #b9c0c6;
}

.key kbd {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #2d3338;
  border-radius: 10px;
  background: #1a1e21;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.45);
  font: 500 0.95rem var(--mono);
  color: #f3f3f3;
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  color: #f4eef6;
}

.pipeline li span {
  font: 500 0.75rem var(--mono);
  color: #ff8fb1;
}

.cs-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cs-pair .principle h3 {
  margin-top: 14px;
}

.cs-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin: 0 0 128px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 26px;
  background: var(--tint);
}

.cs-status h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  letter-spacing: -0.035em;
}

.cs-status p {
  max-width: 560px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #555;
}

.cs-videos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 18px;
}

.cs-video {
  color: var(--text);
  text-decoration: none;
}

.cs-video img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.cs-videos.shorts {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cs-video.vertical img {
  aspect-ratio: 9 / 16;
}

.cs-video span {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

.cs-video:hover span {
  text-decoration: underline;
}

.cs-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 40px;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.cs-next h2 {
  margin: 10px 0 10px;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.cs-next p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.cs-next .proj-media {
  border-radius: 22px;
}

.cs-next:hover .proj-media img {
  transform: scale(1.025);
}

.cs-next:hover h2 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---- Small screens ---- */
@media (max-width: 900px) {
  .proj-grid,
  .card-grid,
  .card-grid-2,
  .cs-pair {
    grid-template-columns: 1fr;
  }

  .card-grid.skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-section {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .cs-section > header {
    position: static;
  }

  .cs-principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-bento {
    grid-template-columns: 1fr;
  }

  .bento.span-2,
  .bento.span-3,
  .bento.span-4,
  .bento.span-6 {
    grid-column: auto;
  }

  .bento.rows-2 {
    grid-row: auto;
  }

  .cs-videos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-videos.shorts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cs-next {
    grid-template-columns: 1fr;
  }

  .cs-next .proj-media {
    order: -1;
  }
}

@media (max-width: 720px) {
  .work2-hero {
    margin-bottom: 48px;
  }

  .work2-block {
    margin-bottom: 72px;
  }

  .work2-head {
    flex-direction: column;
    gap: 4px;
  }

  .work2-head p {
    text-align: left;
  }

  .proj-grid {
    gap: 48px;
  }

  .card-grid.skills {
    grid-template-columns: 1fr;
  }

  .cs-back {
    margin-bottom: 28px;
  }

  .cs-cover {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
  }

  .cs-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 80px;
  }

  .cs-section,
  .cs-stats,
  .cs-showcase,
  .cs-status {
    margin-bottom: 80px;
  }

  .cs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-stat,
  .cs-stat + .cs-stat {
    padding: 22px 16px 22px 0;
    border-left: 0;
  }

  .cs-stat:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--border);
  }

  .cs-stat:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }

  .cs-stage {
    margin-left: -20px;
    margin-right: -20px;
    padding: 28px 20px;
    border-radius: 0;
  }

  .cs-phones {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px 4px;
  }

  .cs-phones::-webkit-scrollbar {
    display: none;
  }

  .cs-phones figure {
    flex: 0 0 46%;
    scroll-snap-align: start;
  }

  .cs-principles {
    grid-template-columns: 1fr;
  }

  .bento {
    padding: 22px;
  }

  .cs-quote-cite {
    margin-top: -40px;
  }

  .cs-status {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Home: the one-page portfolio ---- */
.hero {
  padding: 32px 0 112px;
}

.hero h1 {
  max-width: 1000px;
  margin: 0 0 40px;
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: #9a9a9a;
}

.hero-text {
  max-width: 700px;
}

.hero-text p {
  margin: 0 0 18px;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.65;
  color: #555;
}

.hero-text a {
  color: var(--text);
  font-weight: 500;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.jump a {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.92rem;
  color: #333;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.jump a:hover {
  border-color: #cfcfcf;
  background: #f4f4f2;
}

.block {
  margin: 0 0 136px;
  scroll-margin-top: 24px;
}

.block-head {
  max-width: 780px;
  margin-bottom: 44px;
}

.block-head h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.block-intro {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.65;
  color: #555;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.how-grid .principle {
  --accent: #3d5afe;
  --tint: #f4f5fb;
}

.how-grid .principle p a {
  color: var(--text);
}

.toolrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}

.toolrow b {
  margin-right: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.toolrow span {
  padding: 7px 14px;
  border-radius: 999px;
  background: #f1f1ef;
  font-size: 0.9rem;
  color: #333;
}

.toolrow.quiet span {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
}

/* One project, shown in full on the page */
.pj {
  margin: 0 0 152px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 24px;
}

.pj-head {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 36px;
}

.pj-title {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.pj-sub {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: #555;
}

.pj-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 0 0 22px;
}

.pj-facts dt {
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.pj-facts dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #222;
}

.pj-cover {
  overflow: hidden;
  margin: 0 0 56px;
  border-radius: 26px;
  background: var(--stage);
}

.pj-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.pj-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin: 0 0 64px;
}

.pj-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.pj-stats .cs-stat {
  padding: 24px 20px 24px 0;
  border-bottom: 1px solid var(--border);
}

.pj-stats .cs-stat:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.pj-stats .cs-stat + .cs-stat:nth-child(odd) {
  padding-left: 0;
  border-left: 0;
}

.pj-stats .cs-stat strong {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
}

.pj-part {
  margin: 0 0 64px;
}

.pj-part-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px;
  margin-bottom: 28px;
}

.pj-part-head h4 {
  margin: 10px 0 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.pj-part-head p {
  max-width: 680px;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: #444;
}

.pj-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  padding: 22px 26px;
  border-radius: 20px;
  background: var(--tint);
}

.pj-foot p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #444;
}

.pj-foot .cs-tools {
  margin-top: 0;
}

/* Motion: muted loops of the real thing */
video.motion {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
}

.shot video.motion,
.window video.motion {
  border-radius: 0;
}

.plugin-stage {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 26px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.09) 1px, transparent 1.3px) 0 0 / 18px 18px, #f2f2f0;
}

.plugin-win {
  overflow: hidden;
  width: min(100%, 400px);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.plugin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  background: #2c2c2c;
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
}

.plugin-bar span:last-child {
  font-size: 15px;
  opacity: 0.6;
}

.plugin-win video.motion {
  background: #fff;
}

.figma-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.figma-card h3 {
  margin: 24px 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.figma-card p {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.figma-card .meta {
  font-size: 0.9rem;
  color: var(--faint);
}

.mcard-media video.motion {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mcard-media.vertical {
  position: relative;
  background: linear-gradient(170deg, #cdeaff, #fff2d4);
}

.mcard-media.vertical video.motion {
  position: absolute;
  top: 5%;
  left: 50%;
  width: auto;
  height: 90%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  transform: translateX(-50%);
  box-shadow: 0 20px 40px -20px rgba(20, 60, 90, 0.5);
}

.contact {
  padding: 72px clamp(28px, 5vw, 64px);
  border-radius: 28px;
  background: #111;
  color: #f2f2f2;
}

.contact h2 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.05em;
}

.contact p {
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #bdbdbd;
}

.contact .btn {
  background: #fff;
  color: #111;
}

.contact .btn:hover {
  background: #e9e9e9;
}

.contact .jump a {
  border-color: #333;
  color: #ddd;
}

.contact .jump a:hover {
  border-color: #555;
  background: #1c1c1c;
}

@media (max-width: 900px) {
  .how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pj-head,
  .pj-overview,
  .pj-part-head,
  .figma-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-bottom: 72px;
  }

  .block {
    margin-bottom: 88px;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .pj {
    margin-bottom: 96px;
    padding-top: 40px;
  }

  .pj-cover {
    margin-right: -20px;
    margin-left: -20px;
    border-radius: 0;
  }

  .pj-overview,
  .pj-part {
    margin-bottom: 44px;
  }

  .plugin-stage {
    margin-right: -20px;
    margin-left: -20px;
    border-radius: 0;
  }

  .contact {
    margin-right: -20px;
    margin-left: -20px;
    border-radius: 0;
  }
}

/* ---- Personality: serif accent, sparkles, reveal on scroll ---- */
.serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.sparkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero2 {
  position: relative;
  isolation: isolate;
  margin: -24px -24px 96px;
  padding: 72px 24px 64px;
  border-radius: 32px;
  overflow: hidden;
  background:
    radial-gradient(760px 420px at 88% -10%, rgba(61, 90, 254, 0.07), transparent 62%),
    radial-gradient(640px 380px at -6% 110%, rgba(212, 63, 122, 0.06), transparent 62%);
}

.hero2 > :not(.sparkles) {
  position: relative;
  z-index: 1;
}

.hero2 h1 {
  max-width: 1040px;
  margin: 0 0 32px;
  font-size: clamp(2.8rem, 7.4vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.rotate {
  display: inline;
  margin-right: -0.04em;
  padding-right: 0.04em;
  background: linear-gradient(90deg, #0e7a66, #3d5afe 50%, #d43f7a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.rotate.out {
  opacity: 0;
  filter: blur(8px);
}

.hero-lead {
  max-width: 780px;
  margin: 0 0 20px;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: #2b2b2b;
}

.hero-bio {
  max-width: 720px;
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: #666;
}

.hero-bio a {
  color: var(--text);
  font-weight: 500;
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---- How I work, with a live terminal ---- */
.how2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 56px;
  align-items: start;
}

.how2 > * {
  min-width: 0;
}

.how2-points {
  display: grid;
  gap: 30px;
  margin-top: 8px;
}

.how2-point h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.how2-point h3 span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3d5afe;
}

.how2-point p {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.65;
  color: #555;
}

.how2-point p a {
  color: var(--text);
}

.term {
  overflow: hidden;
  border-radius: 18px;
  background: #0b0d12;
  box-shadow: 0 50px 100px -40px rgba(20, 30, 80, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 90px -24px rgba(61, 90, 254, 0.45);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #141822;
}

.term-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}

.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }

.term-bar span {
  margin: 0 auto;
  transform: translateX(-30px);
  font: 500 12px var(--mono);
  color: #8a93a6;
}

.term-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 400px;
  margin: 0;
  padding: 18px 22px 20px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: 13.5px/1.8 var(--mono);
  color: #e6e9f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-body .t-prompt { color: #4ade80; }
.term-body .t-path { color: #60a5fa; }
.term-body .t-agent { color: #c084fc; }
.term-body .t-ok { color: #34d399; }
.term-body .t-dim { color: #8a93a6; }
.term-body .t-pink { color: #f472b6; }

.term-cursor {
  display: inline-block;
  width: 8px;
  height: 1.15em;
  margin-left: 1px;
  background: #e6e9f0;
  vertical-align: -3px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.cmd-marquee {
  overflow: hidden;
  margin-top: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.cmd-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.cmd-track code {
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef1fd;
  font: 500 13px var(--mono);
  color: #2b3a8f;
  white-space: nowrap;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---- Projects as compact rows that open in place ---- */
.rows {
  display: grid;
  gap: 24px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0 44px;
  align-items: center;
  padding: 28px;
  border-radius: 30px;
  background: var(--tint);
  scroll-margin-top: 24px;
}

.row:nth-child(even) .row-media {
  order: 2;
}

.row-media {
  overflow: hidden;
  border-radius: 20px;
  background: var(--stage);
  aspect-ratio: 16 / 10;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.35);
}

.row-media img,
.row-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-body h3 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.row-sub {
  margin: 0 0 22px;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #444;
}

.row-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.row-facts li {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
}

.row-facts strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
  color: var(--accent);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
}

.row-more {
  grid-column: 1 / -1;
  order: 3;
  margin-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.row-more > summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 18px 0 2px;
  font-weight: 500;
  color: #333;
  list-style: none;
  cursor: pointer;
}

.row-more > summary::-webkit-details-marker {
  display: none;
}

.row-more > summary:hover {
  color: var(--accent);
}

.row-more > summary .less,
.row-more[open] > summary .more {
  display: none;
}

.row-more[open] > summary .less {
  display: inline;
}

.row-more > summary svg {
  transition: transform 0.3s ease;
}

.row-more[open] > summary svg {
  transform: rotate(180deg);
}

.row-more-body {
  --tint: rgba(255, 255, 255, 0.72);
  padding-top: 36px;
  animation: row-in 0.5s ease both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(12px); }
}

/* ---- Tabs ---- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 28px;
  padding: 5px;
  border-radius: 999px;
  background: #f1f1ef;
}

.tabs button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 0.95rem var(--font);
  color: #555;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tabs button span {
  margin-left: 4px;
  font-size: 0.85em;
  color: var(--faint);
}

.tabs button[aria-selected="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: #111;
}

[role="tabpanel"][hidden] {
  display: none;
}

.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.contact > :not(.sparkles) {
  position: relative;
  z-index: 1;
}

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

  .cmd-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }

  .term-cursor {
    animation: none;
  }
}

@media (max-width: 900px) {
  .how2,
  .row {
    grid-template-columns: 1fr;
  }

  .row {
    gap: 22px;
  }

  .row:nth-child(even) .row-media {
    order: 0;
  }
}

@media (max-width: 720px) {
  .hero2 {
    margin: -16px -20px 64px;
    padding: 48px 20px 40px;
    border-radius: 0;
  }

  .row {
    margin: 0 -20px;
    padding: 20px;
    border-radius: 0;
  }

  .term-body {
    height: 360px;
    font-size: 12px;
  }
}
