/* Santor by Nguyen Son Tra, licensed CC BY-ND 3.0 (https://creativecommons.org/licenses/by-nd/3.0/). Served unmodified. */
@font-face {
  font-family: "Santor";
  src: url("/fonts/santor.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Bastardus Sans by m klein (mkf), 2003. Main text face for the whole site. */
@font-face {
  font-family: "Bastardus Sans";
  src: url("/fonts/bastardus-sans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #6b6b73;
  --line: #e6e5e1;
  --brand: #204a81; /* dark blue from "Giant" in the logo */
  --accent: var(--brand);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.08);
  --radius: 10px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --display: "Santor", "Bastardus Sans", ui-sans-serif, system-ui, sans-serif;
  --label: "Bastardus Sans", ui-sans-serif, system-ui, sans-serif;
  --font: "Bastardus Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}


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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header / footer ---------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}
.wordmark { display: block; padding-block: 12px; }
.wordmark img {
  height: clamp(60px, 7vw, 80px);
  width: auto;
}
.site-nav { display: flex; gap: 28px; font-size: 0.95rem; }
.site-nav a, .site-footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
.site-nav a:hover, .site-footer a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-block: 32px;
}

/* Home --------------------------------------------------------------- */
.intro { padding-block: clamp(56px, 10vw, 112px) clamp(40px, 6vw, 64px); }
.intro__title {
  margin: 0 0 16px;
  font-family: var(--display);
  color: var(--brand);
  font-size: clamp(2.75rem, 6.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
}
.intro__text { margin: 0; max-width: 40ch; color: var(--muted); font-size: 1.15rem; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(32px, 4vw, 48px) clamp(20px, 2.5vw, 32px);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: block; text-decoration: none; }
.card__media {
  aspect-ratio: 10 / 7;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .4s;
}
.card:hover .card__media img, .card:focus-visible .card__media img { transform: scale(1.04); }
.card__title { margin: 16px 0 2px; font-size: 1.05rem; font-weight: 400; letter-spacing: -0.01em; }
.card__meta { margin: 0; color: var(--muted); font-size: 0.925rem; }

/* Project ------------------------------------------------------------ */
.project__top { padding-top: 24px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--label);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s;
}
.back span { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.back:hover { color: var(--accent); }
.back:hover span { transform: translateX(-3px); }

/* Phone/tablet: cover as a banner across the top. */
.project__hero { margin: 20px 0 0; }
.project__hero img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}
.project__header { padding-top: clamp(32px, 6vw, 56px); }

/* Desktop: cover becomes a card beside the title and text, like on the portfolio grid. */
@media (min-width: 900px) {
  .project__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 380px);
    grid-template-areas:
      "back   back"
      "header hero"
      "prose  hero";
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(40px, 6vw, 88px);
  }
  .back { grid-area: back; justify-self: start; }
  .project__hero { grid-area: hero; margin-top: clamp(40px, 5vw, 64px); align-self: start; }
  .project__hero img { aspect-ratio: 10 / 7; }
  .project__header { grid-area: header; padding-top: clamp(40px, 5vw, 64px); }
  .prose { grid-area: prose; }
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--label);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.project__title {
  margin: 0;
  font-family: var(--display);
  color: var(--brand);
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.prose { margin-top: 28px; }
.prose > * { max-width: 65ch; }
.prose p { margin: 0 0 1.1em; }
.prose p:first-child { font-size: 1.2rem; line-height: 1.55; }
.prose h2 { margin: 1.8em 0 0.5em; font-size: 1.15rem; font-weight: 400; letter-spacing: -0.01em; }
.prose ul { margin: 0 0 1.4em; padding: 0; list-style: none; }
.prose li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-top: 1px solid var(--line);
}
.prose li:last-child { border-bottom: 1px solid var(--line); }
.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.15em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Screenshot gallery: a horizontal, snap-scrolling strip that starts in line
   with the text column and bleeds off the right-hand edge of the screen. */
.gallery {
  --edge: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  margin-top: clamp(48px, 7vw, 88px);
}
.gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.gallery__head .eyebrow { margin: 0; }
.gallery__nav { display: flex; gap: 8px; }
.gallery__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.gallery__btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.gallery__btn:disabled { opacity: .35; cursor: default; }
.gallery:not(.is-scrollable) .gallery__nav,
.gallery:not(.is-scrollable) .gallery__progress { visibility: hidden; }

.shots {
  list-style: none;
  margin: 0;
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  padding: 16px var(--edge) 40px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shots::-webkit-scrollbar { display: none; }
.shots:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.shots > li {
  flex: 0 0 auto;
  width: clamp(190px, 24vw, 270px);
  scroll-snap-align: start;
}
.shots > li.is-landscape { width: clamp(280px, 40vw, 500px); }
.shots > li.is-landscape .shot { border-radius: clamp(10px, 1.4vw, 16px); }
.shots.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.shots.is-dragging .shot { cursor: grabbing; }
.shots.is-dragging img { pointer-events: none; }

.gallery__progress {
  height: 2px;
  margin-top: -16px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.gallery__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .15s linear;
}

.shot {
  display: block;
  border-radius: clamp(16px, 2.4vw, 26px);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  cursor: zoom-in;
  -webkit-user-drag: none;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s;
}
.shot img { -webkit-user-drag: none; user-select: none; }
.shot:hover { transform: translateY(-6px); }

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  margin-top: clamp(72px, 10vw, 120px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pager a { text-decoration: none; }
.pager__link { font-weight: 400; font-size: 1.05rem; letter-spacing: -0.01em; }
.pager__link span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--label);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pager__link--next { text-align: right; }
.pager__all { color: var(--muted); font-size: 0.9rem; }
.pager a:hover { color: var(--text); opacity: .7; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr 1fr; }
  .pager__all { order: 3; grid-column: 1 / -1; justify-self: center; padding-top: 12px; }
}

/* Image fade-in (added by JS so images stay visible without it) ------ */
.js img.is-loading { opacity: 0; }
.js img { transition: opacity .5s ease; }

/* Lightbox ----------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 48px 64px;
  background: rgb(10 10 12 / 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  width: auto;
  border-radius: 24px;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.2); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 12px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 12px; top: 50%; translate: 0 -50%; }
.lightbox__count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  color: rgb(255 255 255 / 0.6);
  font-size: 0.85rem;
}
@media (max-width: 560px) {
  .lightbox { padding: 64px 12px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 8px; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover .card__media img, .shot:hover { transform: none; }
}

.site-footer__credit { flex-basis: 100%; font-size: 0.8rem; opacity: .7; }

/* Home --------------------------------------------------------------- */
.home { padding-block: clamp(72px, 14vw, 160px) 0; }
.home__title {
  margin: 0 0 28px;
  font-family: var(--display);
  color: var(--brand);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.home__body p:first-child { font-size: 1.35rem; }
.home__cta { margin: 40px 0 0; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}
.button:hover { opacity: .85; }
.button:hover span { transform: translateX(3px); }
.button span { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }

/* Placeholder cover for projects without an image yet. */
.placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 85% 10%, rgb(255 255 255 / 0.14), transparent 60%),
    var(--brand);
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  text-align: center;
  line-height: 1.1;
}
.project__hero .placeholder {
  aspect-ratio: 2 / 1;
  border-radius: var(--radius);
}
@media (min-width: 900px) { .project__hero .placeholder { aspect-ratio: 10 / 7; } }
