:root {
  --ink: #111;
  --muted: #6a6a6a;
  --paper: #fff;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: min(920px, calc(100% - 3rem));
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.85rem;
}

.topbar .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.topbar .nav-link {
  font-size: 0.85rem;
}

.topbar .nav-link:hover {
  text-decoration: underline;
}

.display {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}

.page-title {
  margin: 0 0 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--ink);
}

.hero-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-heading .display {
  margin: 0;
}

.hero-logo {
  display: block;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
}

.hero {
  position: relative;
  width: 100%;
  height: min(52vh, 520px);
  overflow: hidden;
  background: #d8d8d8;
}

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

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, #111);
  pointer-events: none;
}

.hero-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.15rem;
  z-index: 1;
}

.hero .display {
  color: #fff;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
  padding: 0.4rem 0 2.8rem;
}

.card {
  display: block;
  color: inherit;
}

.card:hover .cover {
  opacity: 0.88;
}

.cover {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d8d8d8;
}

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

.card-name {
  margin: 0.7rem 0 0.15rem;
  font-size: 1rem;
  font-weight: 700;
}

.card-company {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.12rem;
}

.type-tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.12rem 0.45rem;
  line-height: 1.2;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.4rem;
  align-items: start;
  padding: 2.4rem 0 2.8rem;
}

.project-layout.is-wide {
  grid-template-columns: 1fr;
}

.kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: 0.55rem;
}

.project-block {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin: 0 0 2.1rem;
}

.project-block:last-of-type {
  margin-bottom: 0;
}

.project-block-label {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  text-align: right;
  padding-top: 0.15rem;
}

.project-block-label .kicker {
  margin-bottom: 0;
  font-size: 0.88rem;
  letter-spacing: 0;
}

.project-nav-link {
  font-size: 0.88rem;
  line-height: 1.3;
}

.project-block-label .project-nav-link:first-of-type {
  margin-top: 0.45rem;
}

.copy p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.project-block-body p:last-child {
  margin-bottom: 0;
}

.project-section + .project-section {
  margin-top: 1.15rem;
}

.project-section.has-logo {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.8rem;
  align-items: start;
}

.app-logo {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 12px;
  object-fit: cover;
}

.project-section-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
}

.project-section p {
  margin: 0 0 0.85rem;
}

.project-section p:last-child {
  margin-bottom: 0;
}

.copy .muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.copy a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.device-col {
  position: sticky;
  top: 1.25rem;
}

.device-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.device {
  position: relative;
  width: 250px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 32px;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.device-screen {
  position: relative;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: 22px;
  background: #e8e8e8;
  pointer-events: none;
}

.device-screen img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.device-screen img.is-active {
  display: block;
}

.device-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.device-arrow {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 3rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.device-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.device-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #cfcfcf;
  cursor: pointer;
}

.device-dot.is-active {
  background: var(--ink);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin: 4rem 0 0;
}

.photo-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d8d8d8;
  cursor: pointer;
}

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

.photo-thumb:hover { opacity: 0.88; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.92);
  padding: 3.5rem 4.5rem;
}

.lightbox[hidden] { display: none; }

body.lightbox-open { overflow: hidden; }

.lightbox img {
  display: block;
  max-width: min(1100px, calc(92vw - 5.5rem));
  max-height: 86vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  top: 0.7rem;
  right: 1rem;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  width: 2.75rem;
  height: 4.5rem;
  margin-top: -2.25rem;
  font-size: 2.2rem;
  line-height: 1;
}

.lightbox-prev { left: 0.4rem; }
.lightbox-next { right: 0.4rem; }

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--ink);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pager-link-next { text-align: right; }

.pager-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--muted);
}

.pager-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.pager-home {
  font-size: 0.85rem;
}

.pager-home:hover,
.pager-link:hover .pager-name {
  text-decoration: underline;
}

footer {
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--ink);
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .project-layout {
    grid-template-columns: 1fr auto;
    gap: 1.25rem;
  }
  .project-layout.is-wide { grid-template-columns: 1fr; }
  .device { width: 210px; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .wrap { width: calc(100% - 2rem); }
  .gallery { grid-template-columns: 1fr; }
  .project-layout { grid-template-columns: 1fr; }
  .project-block {
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
  }
  .project-block-label { padding-top: 0.1rem; }
  .device-col { position: static; }
  .device { width: 250px; }
  .hero { height: 38vh; }
  .hero-logo {
    width: 2.35rem;
    height: 2.35rem;
  }
  .lightbox { padding: 3.2rem 1.2rem; }
  .pager {
    grid-template-columns: 1fr 1fr;
  }
  .pager-home {
    grid-column: 1 / -1;
    order: -1;
    text-align: center;
  }
}
