@font-face {
  font-family: "Ars Region";
  src: url("fonts/ARSRegionPro-Regular.woff2") format("woff2"),
    url("fonts/ARSRegionPro-Regular.woff") format("woff"),
    url("fonts/ARSRegionPro-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --site-font-family: "Ars Region", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --site-font-size-base: 15px;
  --site-font-size-small: 12px;
  --site-font-size-title: clamp(28px, 3.6vw, 58px);
  --site-font-size-card: clamp(20px, 2.2vw, 42px);
  --site-line-height: 0.95;

  --site-bg: #ffffff;
  --site-fg: #141414;
  --site-border-color: #747474;
  --site-card-bg: #ffffff;
  --site-card-fg: #242424;
  --site-card-border: #b9b9b9;

  --dot-size: 70px;
  --dot-gap: 9px;
  --dot-shape: 999px;
  --dot-color: #050505;
  --dot-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
  --dot-viewed-alpha: 0.5;
  --dot-viewed-color: rgba(5, 5, 5, var(--dot-viewed-alpha));
  --dot-hover-scale: 1.08;

  --project-gap-x: 0px;
  --project-gap-y: 0px;
  --board-padding: 6px;

  --card-radius: 6px;
  --card-padding-x: 14px;
  --card-padding-y: 10px;
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

  --text-chip-width: 260px;
  --text-chip-height: 140px;

  --scrollbar-size: 20px;
  --scrollbar-track: rgba(0, 0, 0, 0.05);
  --scrollbar-thumb: rgba(0, 0, 0, 1);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 1);
  --scrollbar-roundness: 999px;
  --scrollbar-thumb-inset: 3px;

  /* ── Custom scrollbar geometry ── */
  --sb-size: 40px;
  --frame-gap: 20px;
  --sb-offset: calc(var(--frame-gap) - (var(--sb-size) / 2));
  --sb-line-color: #000;
  --sb-thumb-color: #000;
  --sb-thumb-girth: 14px;
  --sb-corner-dot-size: 14px;

  --overlay-bg: rgba(239, 239, 239, 0.93);
  --overlay-image-fit: contain;
  --overlay-image-max-width: 100vw;
  --overlay-image-max-height: 100vh;
  --overlay-z-index: 3;

  --ui-z-index: 6;
  --modal-z-index: 8;

  --modal-width: min(880px, 88vw);
  --modal-height: min(78vh, 820px);
  --modal-bg: #f4f4f4;
  --modal-border: #a6a6a6;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body.home,
body.blog {
  height: 100%;
  overflow: hidden;
}

body.single,
body.page {
  overflow: auto;
}

body {
  font-family: var(--site-font-family);
  font-size: var(--site-font-size-base);
  background: var(--site-bg);
  color: var(--site-fg);
}

.site-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.site-header {
  position: fixed;
  left: 24px;
  top: 14px;
  z-index: var(--ui-z-index);
  pointer-events: none;
}

.brand-kicker {
  margin: 0 0 8px;
  font-size: var(--site-font-size-small);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(30px, 4.1vw, 64px);
  line-height: var(--site-line-height);
  letter-spacing: -0.01em;
}

.site-footer {
  display: none;
}

.viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100vw - var(--frame-gap));
  height: calc(100vh - var(--frame-gap));
  overflow: auto;
  cursor: grab;
  border: 0;
  scrollbar-width: none;
}

.viewport::-webkit-scrollbar {
  display: none;
}

.viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.board {
  position: relative;
  width: max-content;
  padding: var(--board-padding);
}

.project-cluster {
  position: absolute;
  overflow: hidden;
  isolation: isolate;
}

.dot {
  float: left;
  width: var(--dot-size);
  height: var(--dot-size);
  border: 0;
  border-radius: var(--dot-shape);
  margin: calc(var(--dot-gap) / 2);
  padding: 0;
  background-color: var(--dot-color);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  box-shadow: var(--dot-shadow);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.dot:hover,
.dot:focus-visible {
  transform: scale(var(--dot-hover-scale));
  outline: none;
}

.dot.viewed {
  background-color: var(--dot-viewed-color);
}

.dot.filler {
  background-image: none !important;
  background-color: var(--dot-color);
  cursor: default;
}

.dot.filler:hover,
.dot.filler:focus-visible {
  transform: none;
}

.title-card,
.text-chip {
  position: absolute;
  z-index: 2;
  background: var(--site-card-bg);
  color: var(--site-card-fg);
  border: 1px solid var(--site-card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.title-card {
  cursor: pointer;
  /* override shared rule */
  float: left;
  position: relative;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: var(--card-padding-y) var(--card-padding-x);
  padding-right: 90px;
  max-width: min(480px, 88vw);
  margin: calc(var(--dot-gap) / 2);
}

.title-card h2 {
  margin-top: 10px;
  margin-bottom: 50px;
  font-size: var(--site-font-size-card);
  line-height: 0.95;
  font-weight: 400;
}

.title-card p {
  margin: 0;
  position: absolute;
  top: 10px;
  right: 12px;
  text-align: right;
  font-size: var(--site-font-size-small);
}

.title-card.vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 220px;
  max-height: 480px;
  max-width: none;
  padding-right: var(--card-padding-x);
  padding-bottom: 60px;
}

.title-card.vertical p {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  margin: 0;
  position: absolute;
  top: 10px;
  right: 10px;
}

.text-chip {
  width: var(--text-chip-width);
  min-height: var(--text-chip-height);
  padding: 14px;
  font-size: 14px;
  line-height: 1.1;
  cursor: pointer;
}

.text-chip strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 400;
}

.hover-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--overlay-z-index);
  display: grid;
  place-items: center;
  background: var(--overlay-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
}

.hover-overlay.active {
  opacity: 1;
}

.hover-overlay img {
  width: var(--overlay-image-max-width);
  height: var(--overlay-image-max-height);
  object-fit: var(--overlay-image-fit);
}

.text-modal {
  position: fixed;
  inset: 0;
  z-index: var(--modal-z-index);
  display: grid;
  place-items: center;
  background: rgba(239, 239, 239, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 130ms ease;
}

.text-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.text-modal-card {
  position: relative;
  width: var(--modal-width);
  max-height: var(--modal-height);
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 8px;
  padding: 18px 20px 20px;
}

.text-modal-card h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 0.95;
  font-weight: 400;
}

.text-modal-card p {
  margin: 8px 0 16px;
  font-size: 14px;
}

.text-modal-body {
  max-height: calc(var(--modal-height) - 130px);
  overflow: auto;
  font-size: clamp(18px, 1.45vw, 24px);
  line-height: 1.16;
  white-space: pre-line;
  padding-right: 8px;
}

.text-modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
}

/* ── Custom scrollbars ───────────────────────────────────────── */

.sb-h {
  position: fixed;
  bottom: var(--sb-offset);
  left: 0;
  right: var(--sb-offset);
  height: var(--sb-size);
  z-index: calc(var(--ui-z-index) + 1);
  background: none;
  /* 1px line centred vertically */
  background-image: linear-gradient(
    to bottom,
    transparent calc(50% - 0.5px),
    var(--sb-line-color) calc(50% - 0.5px),
    var(--sb-line-color) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

.sb-v {
  position: fixed;
  top: 0;
  right: var(--sb-offset);
  bottom: var(--sb-offset);
  width: var(--sb-size);
  z-index: calc(var(--ui-z-index) + 1);
  background: none;
  /* 1px line centred horizontally */
  background-image: linear-gradient(
    to right,
    transparent calc(50% - 0.5px),
    var(--sb-line-color) calc(50% - 0.5px),
    var(--sb-line-color) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

.sb-thumb-h {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: var(--sb-thumb-girth);
  border-radius: 999px;
  background: var(--sb-thumb-color);
  cursor: grab;
  user-select: none;
  min-width: 40px;
}

.sb-thumb-v {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--sb-thumb-girth);
  border-radius: 999px;
  background: var(--sb-thumb-color);
  cursor: grab;
  user-select: none;
  min-height: 40px;
}

.sb-thumb-h.is-dragging,
.sb-thumb-v.is-dragging {
  cursor: grabbing;
}

.sb-label-h {
  position: absolute;
  left: 12px;
  top: 80%;
  transform: translateY(-50%);
  font-size: var(--site-font-size-small);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
}

.sb-label-v {
  position: absolute;
  right: 3px;
  bottom: 45px;
  font-size: var(--site-font-size-small);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.sb-corner {
  position: fixed;
  bottom: var(--sb-offset);
  right: var(--sb-offset);
  width: var(--sb-size);
  height: var(--sb-size);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: calc(var(--ui-z-index) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* cross lines in corner square */
.sb-corner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, transparent calc(50% - 0.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

/* reset dot */
.sb-corner::after {
  content: '';
  position: relative;
  z-index: 1;
  width: var(--sb-corner-dot-size);
  height: var(--sb-corner-dot-size);
  background: var(--dot-color);
  border-radius: 50%;
}
@media (max-width: 900px) {
  :root {
    --dot-size: 70px;
    --dot-gap: 7px;
    --text-chip-width: 210px;
  }

  .site-header {
    left: 16px;
    top: 10px;
  }

  .site-header h1 {
    font-size: clamp(24px, 9vw, 44px);
  }

  .title-card h2 {
    font-size: clamp(18px, 5.3vw, 30px);
  }

  .board {
    width: max-content;
  }
}


.project-page,
body.single {
  overflow: auto;
  background: var(--site-bg);
}

.project-shell {
  width: 100%;
  padding: 18px 18px 40px;
}

.project-title {
  margin: 0 54px 18px 0;
  font-size: var(--site-font-size-title);
  line-height: var(--site-line-height);
  font-weight: 400;
}

.project-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 20;
  color: var(--site-fg);
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
}

.project-gallery {
  column-count: 2;
  column-gap: 10px;
}

.project-gallery img {
  display: block;
  width: 100%;
  max-height: 100vh;
  margin: 0 0 10px;
  object-fit: contain;
  break-inside: avoid;
}

.project-empty {
  margin: 0;
  font-size: var(--site-font-size-base);
}

@media (max-width: 700px) {
  .project-shell {
    padding: 14px 14px 34px;
  }

  .project-title {
    margin-right: 42px;
  }
}
