:root {
  --page: #f7f7f5;
  --ink: #171717;
  --muted: #747474;
  --line: rgba(23, 23, 23, 0.10);
  --panel: #ffffff;
  --radius: 18px;
  --drawer-width: min(460px, 92vw);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.drawer-open { overflow: hidden; }

button, a { -webkit-tap-highlight-color: transparent; }

.works-shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.works-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.works-heading {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.works-header h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.works-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.language-toggle {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.language-option {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  transition: color 140ms ease;
}

.language-option:hover { color: var(--ink); }

.language-option.is-active {
  color: var(--ink);
  font-weight: 620;
}

.language-option:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
  border-radius: 2px;
}

.language-divider {
  color: rgba(23, 23, 23, 0.22);
  user-select: none;
}

.works-intro {
  max-width: 68ch;
  margin: 0 0 16px;
  color: #555;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
}

.profile-trigger:hover { color: #555; }

.profile-trigger:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.works-filters {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.works-filters::-webkit-scrollbar { display: none; }

.works-filter {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #595959;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.works-filter:hover { border-color: rgba(23, 23, 23, 0.28); color: var(--ink); }

.works-filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.works-filter:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.work-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #ececea;
  cursor: pointer;
  appearance: none;
  text-align: left;
  transform: translateZ(0);
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: inherit;
  pointer-events: none;
}

.work-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.work-card:hover img,
.work-card:focus-visible img { transform: scale(1.015); }

.work-card:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.work-card-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  padding: 24px;
  color: #3c3c3c;
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-align: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.95), transparent 38%),
    linear-gradient(145deg, #deded9, #f4f4f1);
}

.work-card.is-fallback img { display: none; }
.work-card.is-fallback .work-card-fallback { display: grid; }

.works-state,
.noscript {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.14);
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer-backdrop.is-open { opacity: 1; }

.work-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: var(--drawer-width);
  height: 100dvh;
  padding: 28px 28px 36px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.10);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(.22,.8,.3,1);
}

.work-drawer.is-open { transform: translateX(0); }

.drawer-close {
  display: grid;
  width: 36px;
  height: 36px;
  margin: -8px -8px 36px auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.drawer-close:hover { background: #f2f2ef; }
.drawer-close:focus-visible { outline: 2px solid #111; }

.drawer-eyebrow {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.drawer-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 650;
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-heading .drawer-eyebrow { margin-bottom: 7px; }
.profile-heading .drawer-title { font-size: clamp(28px, 3.5vw, 40px); }

.profile-avatar {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #ececea;
}

.profile-links { margin-top: 36px; }

.drawer-one-liner {
  margin: 18px 0 0;
  max-width: 28ch;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.drawer-description {
  margin: 44px 0 0;
  max-width: 42ch;
  color: #3f3f3f;
  font-size: 15px;
  line-height: 1.65;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.drawer-tag {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4a4a4a;
  font-size: 11px;
}

.drawer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-links a {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.drawer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

@media (max-width: 620px) {
  .works-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 24px;
  }

  .works-header { gap: 16px; }
  .works-grid { grid-template-columns: 1fr; }

  .work-drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(84dvh, 720px);
    border-radius: 22px 22px 0 0;
    transform: translateY(102%);
  }

  .work-drawer.is-open { transform: translateY(0); }
}

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

/* Consistent site navigation, adapted to the minimal Works visual language. */
.works-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 12px;
  margin-bottom: 42px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.works-brand {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.works-topbar .site-nav { display: flex; align-items: center; gap: 24px; }
.works-topbar .site-nav a {
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
}
.works-topbar .site-nav a:hover,
.works-topbar .site-nav a[aria-current="page"] { color: var(--ink); }
.works-topbar .site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.works-topbar .site-nav a:focus-visible,
.works-brand:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@media (max-width: 620px) {
  .works-topbar { margin-bottom: 30px; }
  .works-topbar .site-nav { gap: 18px; }
}
