:root {
  --bg: #f4f1ea;
  --text: #1c1b18;
  --muted: #6f6b63;
  --line: #ddd8ce;
  --link: #1c1b18;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --text: #ece9e2;
    --muted: #9a958b;
    --line: #2e2c28;
    --link: #ece9e2;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 6rem;
}

main.home {
  max-width: 72rem;
}

.home .name {
  font-size: clamp(2.75rem, 7vw, 4rem);
}

.projects-section h2 {
  margin-bottom: 1rem;
}

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.home .projects {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 859px) {
  .home .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 559px) {
  .home .projects {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 860px) {
  .home .project-card {
    padding: 1.05rem;
  }
}

.project-card-wrap {
  perspective: 900px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  color: inherit;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    transform 0.55s cubic-bezier(0.23, 1, 0.32, 1),
    border-color 0.2s ease,
    box-shadow 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.project-card-title a:hover {
  color: var(--muted);
}

.project-card-meta a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.project-card-meta a:hover {
  color: var(--muted);
}

.project-card-window {
  margin-top: auto;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.03);
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
  transform: translateZ(12px);
}

.project-card.is-hover {
  border-color: var(--muted);
  transition:
    transform 0.08s ease-out,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  box-shadow:
    0 22px 44px -28px rgba(28, 27, 22, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

@media (prefers-color-scheme: dark) {
  .project-card.is-hover {
    box-shadow:
      0 26px 50px -30px rgba(0, 0, 0, 0.75),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  }
}

.project-card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  mix-blend-mode: screen;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.14) 18%,
    transparent 52%
  );
  transition: opacity 0.25s ease;
}

.project-card.is-hover .project-card-shine {
  opacity: 1;
}

.project-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.project-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.project-card-body p {
  margin: 0;
}

.project-card-copy {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.project-card-window-bar {
  height: 1.35rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(0, 0, 0, 0.02)
  );
}

.project-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  line-height: 0;
  background: #0d0d0d;
  position: relative;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: border-color 0.2s ease;
  }

  .project-card-shine {
    display: none;
  }

  .project-card-body,
  .project-card-window {
    transform: none;
  }
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.name {
  font-size: 4rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.roles {
  margin-top: 0.3rem;
  color: var(--muted);
}

h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.4rem 0 0.85rem;
}

p {
  margin: 0.7rem 0 0;
}

.lede {
  margin-top: 0.2rem;
  color: var(--muted);
}

header {
  margin-bottom: 1.6rem;
}

header .links {
  margin-top: 0.85rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9em;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration: underline;
}

.back,
.project-card-window {
  text-decoration: none;
}

a:hover {
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.links a {
  text-decoration: underline;
  border-bottom: none;
  padding-bottom: 0;
}

.links a,
.links .link-btn {
  padding-bottom: 0.05rem;
}

.links .link-btn {
  font: inherit;
  color: inherit;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
  text-decoration: none;
}

.links a:hover,
.links .link-btn:hover {
  border-bottom-color: var(--muted);
}

@media (max-width: 480px) {
  main {
    padding-top: 2.75rem;
  }
}

.back {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.back:hover {
  color: var(--text);
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

main.wide {
  max-width: 52rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.stat {
  border: 1px solid var(--line);
  padding: 0.85rem 0.9rem;
}

.stat b {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.stat span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

.phones {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  margin: 1.25rem 0 0;
  padding: 0.15rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.phones img {
  height: 22rem;
  width: auto;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.cta {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
  border: 1px solid var(--text);
  padding: 0.4rem 0.75rem;
}

.cta:hover {
  color: var(--bg);
  background: var(--text);
}

.steps {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
}

.steps li {
  margin: 0.35rem 0;
}

.product-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  margin-top: 1.1rem;
}

.product-links img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
}

.ad {
  margin: 1.25rem 0 0;
  line-height: 0;
}

.ad video {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #0d0d0d;
}

.shots {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0 0;
}

.shots img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.shots-small {
  max-width: 20rem;
}

.shots-compact {
  flex-direction: row;
  align-items: flex-end;
  overflow-x: auto;
  margin: 1.25rem 0 0;
  padding: 0.15rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.shots-compact img {
  width: auto;
  height: 17rem;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center top;
}

.shots-ballhog img {
  background: #c8b08a;
}

.stack-table {
  width: 100%;
  margin: 1rem 0 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.stack-table th,
.stack-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stack-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-table td:first-child {
  width: 38%;
  color: var(--muted);
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: 1fr;
  }
}
