@font-face { font-family: "Kibernetyk Mono"; src: url("fonts/KibernetykMono-Thin.woff2") format("woff2"); font-weight: 100; font-display: swap; }
@font-face { font-family: "Kibernetyk Mono"; src: url("fonts/KibernetykMono-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Kibernetyk Mono"; src: url("fonts/KibernetykMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kibernetyk Mono"; src: url("fonts/KibernetykMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Kibernetyk Mono"; src: url("fonts/KibernetykMono-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6e6e6e;
  --line: #e3e3e3;
  --frame: #f2f2f2;
  --mono: "Kibernetyk Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #ffffff;
    --muted: #8f8f8f;
    --line: #262626;
    --frame: #111111;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { font-weight: 500; text-decoration: none; }
.handle { margin-left: .8em; color: var(--muted); font-weight: 400; }
.top nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.top nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
.top nav a:hover { color: var(--ink); }

/* hero */
.hero { padding-top: clamp(56px, 12vw, 160px); padding-bottom: clamp(56px, 9vw, 120px); }
.eyebrow { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.hero h1 {
  max-width: 22ch;
  font: 300 clamp(32px, 6vw, 84px)/1.05 var(--mono);
  letter-spacing: -0.06em;
}
.hero h1 em { font-style: normal; background: var(--ink); color: var(--bg); padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* sections */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 18px 0 28px; border-top: 1px solid var(--line);
}
.section-head h2 { font-size: 14px; font-weight: 500; }
.section-head span { color: var(--muted); font-size: 14px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 24px; padding-bottom: 96px; }
.card { text-decoration: none; display: block; }
.card.wide { grid-column: 1 / -1; }
.card-img { position: relative; width: 100%; overflow: hidden; border-radius: 6px; background: var(--frame); aspect-ratio: 16 / 10; }
.card.wide .card-img { aspect-ratio: 16 / 8; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card-img.pin-top img { object-position: top; }
.card-img.pin-left img { object-position: left; }
.card:hover .card-img img { transform: scale(1.025); }
.card-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding-top: 16px; }
.card-text h3 { font-size: 17px; letter-spacing: -0.02em; }
.card-text p { grid-column: 1; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 52ch; }
.tags { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 6px; margin: 0; padding: 0; list-style: none; max-width: 260px; }
.tags li { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

/* side projects */
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-bottom: 96px; }
.side { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-img { position: relative; border-radius: 6px; overflow: hidden; background: var(--frame); aspect-ratio: 1; }
.side-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side h3 { font-size: 18px; margin-bottom: 6px; }
.side p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.more { text-decoration: underline; text-underline-offset: .2em; font-size: 14px; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; padding-bottom: 112px; }
.about .prose p:first-child { font: 300 clamp(20px, 2.2vw, 26px)/1.35 var(--mono); letter-spacing: -0.04em; }
.skills { margin: 0; display: grid; gap: 20px; }
.skills dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.skills dd { margin: 0; font-size: 14px; }

/* case page */
.case-head { padding-top: clamp(40px, 7vw, 96px); padding-bottom: 48px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 36px; }
.back:hover { color: var(--ink); }
.case-head h1 { font: 300 clamp(32px, 5.4vw, 76px)/1.05 var(--mono); letter-spacing: -0.06em; max-width: 20ch; }
.lead { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; max-width: 40ch; margin: 24px 0 48px; color: var(--muted); }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); }
.meta dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.meta dd { margin: 0; font-size: 14px; }

.case-body { display: grid; gap: 56px; padding-bottom: 96px; }
.prose { max-width: 680px; }
.case-body .prose { margin-left: max(0px, calc((100% - 680px) * 0.32)); }
.prose h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.media figure { margin: 0; }
.media img { width: 100%; border-radius: 6px; background: var(--frame); cursor: zoom-in; }
.media img[style] { object-fit: cover; object-position: top; }
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.45; max-width: 64ch; }
.grid { display: grid; gap: 20px; align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }

.scroller {
  height: min(80vh, 860px);
  overflow-y: auto; overscroll-behavior: contain;
  border-radius: 8px; border: 1px solid var(--line); background: var(--frame);
}
.scroller img { border-radius: 0; cursor: default; }
.phones { display: flex; justify-content: center; gap: 40px; }
.phone { width: min(100%, 360px); }
.phone-screen {
  height: min(78vh, 740px);
  border: 10px solid var(--ink); border-radius: 40px;
  scrollbar-width: none;
}
.phone-screen::-webkit-scrollbar { display: none; }
.phone figcaption { text-align: center; max-width: none; }

.next {
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; padding-top: 24px; padding-bottom: 96px; border-top: 1px solid var(--line);
}
.next span { color: var(--muted); font-size: 14px; }
.next strong { font: 300 clamp(26px, 3.6vw, 52px)/1.1 var(--mono); letter-spacing: -0.05em; }
.next:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }

/* footer */
.foot { padding-top: 40px; padding-bottom: 48px; border-top: 1px solid var(--line); }
.foot-lead { margin: 0; color: var(--muted); }
.foot-mail { display: inline-block; margin: 8px 0 40px; font: 300 clamp(40px, 7.4vw, 104px)/1 var(--mono); text-decoration: none; letter-spacing: -0.07em; }
.foot-mail:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 24px; }
.foot-links a { text-decoration: none; color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
.foot-small { margin: 32px 0 0; font-size: 13px; color: var(--muted); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background: rgba(10, 10, 9, .92); cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox button {
  position: absolute; top: 12px; right: 16px;
  width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 32px; cursor: pointer;
}

@media (max-width: 900px) {
  .cards, .sides, .about-grid { grid-template-columns: 1fr; }
  .card.wide .card-img { aspect-ratio: 16 / 10; }
  .card-text { grid-template-columns: 1fr; }
  .tags { grid-column: 1; grid-row: auto; justify-content: flex-start; max-width: none; margin-top: 6px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-body .prose { margin-left: 0; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .side { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .top nav a:first-child { display: none; }
  .brand { line-height: 1.25; }
  .handle { display: block; margin-left: 0; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-img img { transition: none; }
}
