:root {
  color-scheme: light;
  --ink: #000;
  --paper: #fff;
  --muted: #4a4a4a;
  --line: #d7d7d7;
  --pill: #f0f0f0;
  --content: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 104px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

code {
  padding: 0.12em 0.3em;
  background: #f0f0f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Social navigation */
.site-header {
  width: 100%;
}

.social-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 40px);
}

.social-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.social-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Home */
.home-main {
  width: 100%;
  min-height: calc(100vh - 168px);
  min-height: calc(100dvh - 168px);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: clamp(16px, 4vw, 64px);
  padding: 20px clamp(16px, 4vw, 40px) 32px;
}

.name-block,
.creative-block {
  flex: 1 1 0;
  min-width: 0;
}

.name-block {
  align-self: center;
}

.name-block h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 7.2rem);
  line-height: 1.08;
}

.name-block > p {
  max-width: 390px;
  margin: 24px 0 0;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  letter-spacing: 0.1em;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

a.button:hover,
a.button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.creative-block {
  align-self: flex-end;
}

.creative-block p {
  margin: 0;
  font-size: clamp(1.55rem, 4.3vw, 4.4rem);
  font-weight: 700;
  line-height: 1.16;
  text-align: right;
}

/* Fixed primary navigation */
footer {
  position: fixed;
  z-index: 20;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

.bottom-nav {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  background: rgba(240, 240, 240, 0.96);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
}

.bottom-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.bottom-nav a.active {
  background: var(--ink);
  color: var(--paper);
}

.bottom-nav a:not(.active):hover {
  background: #dcdcdc;
}

/* Work gallery */
.work-main {
  width: 100%;
  max-width: var(--content);
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px clamp(16px, 4vw, 40px) 80px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 350px;
  gap: clamp(18px, 3vw, 40px);
}

.gallery-item {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #111;
  color: var(--paper);
  text-decoration: none;
}

.gallery-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 220ms ease, transform 300ms ease;
}

.project-cue,
.project-title,
.project-tagline {
  position: absolute;
  left: 50%;
  z-index: 1;
  width: 88%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.project-cue {
  top: 22px;
  font-size: clamp(0.62rem, 0.9vw, 0.76rem);
  letter-spacing: 0.12em;
}

.project-title {
  top: 46%;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.project-tagline {
  bottom: 10%;
  max-width: 640px;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  line-height: 1.4;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  opacity: 0.35;
  transform: scale(1.015);
}

.gallery-item:hover .project-cue,
.gallery-item:hover .project-title,
.gallery-item:hover .project-tagline,
.gallery-item:focus-visible .project-cue,
.gallery-item:focus-visible .project-title,
.gallery-item:focus-visible .project-tagline {
  opacity: 1;
}

/* Project pages */
.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  width: 100%;
  max-width: var(--content);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px);
}

.project-text {
  justify-self: center;
  max-width: 540px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.75rem !important;
  letter-spacing: 0.16em;
}

.project-text h1 {
  margin: 0 0 22px;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.98;
}

.project-text > p {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.6;
}

.project-text .tech-stack {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.project-media {
  width: 100%;
}

.project-media img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.wide-chart {
  padding: clamp(16px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.project-snapshot {
  width: 100%;
  padding: clamp(64px, 8vw, 112px) clamp(20px, 4vw, 60px);
  background: #f3f3f3;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
  width: min(100%, 1320px);
  margin: 0 auto;
}

.snapshot-visual {
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: var(--paper);
}

.snapshot-visual img {
  width: 100%;
  max-height: 700px;
  object-fit: contain;
}

.snapshot-visual:not(.landscape) img {
  width: auto;
  max-width: 100%;
}

.snapshot-visual figcaption {
  width: 100%;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.snapshot-copy {
  max-width: 560px;
}

.snapshot-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.08;
}

.snapshot-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.snapshot-meta div {
  padding-top: 12px;
  border-top: 1px solid #bdbdbd;
}

.snapshot-meta div:last-child {
  grid-column: 1 / -1;
}

.snapshot-meta dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snapshot-meta dd {
  margin: 0;
}

.capability-list {
  padding-left: 1.2em;
  margin: 0;
}

.capability-list li + li {
  margin-top: 8px;
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 64px clamp(16px, 4vw, 40px) 96px;
}

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

.details-gallery img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.project-screens {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-screens img {
  width: 100%;
  height: min(52vw, 620px);
  min-height: 340px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  background: #f7f7f7;
  object-fit: contain;
}

.single-screen {
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}

.project-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 6vw, 88px);
  max-width: 1120px;
  margin: 0 auto;
}

.project-copy-grid h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.project-copy-grid p {
  margin: 0;
  line-height: 1.7;
}

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

.project-pagination {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 60px) 136px;
}

.project-pagination a {
  min-height: 44px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.project-pagination a:nth-child(2) {
  text-align: center;
}

.project-pagination a:last-child {
  text-align: right;
}

/* About */
.about-main {
  width: 100%;
}

.about-section,
.direction-section,
.studies-section {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 72px clamp(24px, 4vw, 60px);
}

.about-section h1,
.direction-section h2,
.studies-section h2 {
  margin: 0 0 40px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
}

.about-summary p {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.6;
}

.about-description p {
  margin: 0;
  color: #333;
}

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

.about-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
  font-size: 0.95rem;
}

.about-links a {
  text-underline-offset: 4px;
}

.direction-entry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}

.direction-entry h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.direction-entry p {
  margin: 0;
  color: #333;
}

.studies-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.studies-list li {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) minmax(180px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #ddd;
  font-size: 1rem;
}

.studies-list .year {
  width: fit-content;
  padding: 4px 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
}

.studies-list .place {
  color: #333;
  font-size: 0.9rem;
  text-align: right;
}

/* Not found */
.not-found-main {
  display: grid;
  place-content: center;
  min-height: calc(100vh - 104px);
  min-height: calc(100dvh - 104px);
  padding: 32px;
  text-align: center;
}

.not-found-main h1 {
  margin: 0;
  font-size: clamp(5rem, 18vw, 12rem);
  line-height: 0.9;
}

.not-found-main p {
  max-width: 480px;
  margin: 24px auto 0;
}

.not-found-main .button {
  margin: 28px auto 0;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 96px;
  }

  .social-nav {
    gap: 20px;
  }

  .home-main {
    min-height: calc(100dvh - 160px);
    gap: 14px;
    padding-top: 12px;
  }

  .name-block h1 {
    font-size: clamp(2rem, 9vw, 3.4rem);
  }

  .creative-block p {
    font-size: clamp(1rem, 4.5vw, 1.8rem);
  }

  .home-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  footer {
    bottom: 14px;
  }

  .bottom-nav {
    width: min(100%, 320px);
  }

  .bottom-nav a {
    flex: 1;
    min-width: 0;
    padding-inline: 10px;
  }

  .work-main {
    padding: 16px 16px 64px;
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
    gap: 16px;
  }

  .gallery-item.large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-item img {
    opacity: 0.45;
  }

  .gallery-item .project-cue,
  .gallery-item .project-title,
  .gallery-item .project-tagline {
    opacity: 1;
  }

  .project-title {
    font-size: 1.8rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 40px;
    padding: 56px 20px;
  }

  .project-text h1 {
    font-size: clamp(2.4rem, 13vw, 4rem);
  }

  .project-media {
    max-width: 560px;
  }

  .snapshot-grid,
  .project-copy-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-visual {
    min-height: 0;
  }

  .snapshot-copy {
    max-width: none;
  }

  .snapshot-meta {
    grid-template-columns: 1fr;
  }

  .snapshot-meta div:last-child {
    grid-column: auto;
  }

  .details-gallery {
    grid-template-columns: 1fr;
  }

  .project-screens img {
    height: auto;
    min-height: 0;
  }

  .project-pagination {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-bottom: 128px;
  }

  .project-pagination span {
    display: none;
  }

  .project-pagination a,
  .project-pagination a:nth-child(2),
  .project-pagination a:last-child {
    text-align: left;
  }

  .about-section,
  .direction-section,
  .studies-section {
    padding: 56px 24px;
  }

  .about-grid,
  .about-links,
  .direction-entry {
    grid-template-columns: 1fr;
  }

  .about-links {
    gap: 22px;
  }

  .studies-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .studies-list .place {
    text-align: left;
  }
}

@media (hover: none) {
  .gallery-item img {
    opacity: 0.5;
  }

  .gallery-item .project-cue,
  .gallery-item .project-title,
  .gallery-item .project-tagline {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
