:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --ink: #1c1a17;
  --body: #3a3631;
  --muted: #5e5850;
  --dashed: #8a8379;
  --chip: #efeae2;
  --stripe: #f1ede6;
  --orange: oklch(0.72 0.16 45);
  --green: oklch(0.72 0.16 160);
  --blue: oklch(0.72 0.16 260);
  --live-tint: oklch(0.9 0.07 45);
  --spring: cubic-bezier(.3, 1.6, .5, 1);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--ink); }
a:hover { color: oklch(0.6 0.17 45); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
button { font: inherit; color: inherit; }

/* per-card tilt and accent, cycled in the build */
.t0 { --tilt: -1.2deg; } .t1 { --tilt: 1.2deg; } .t2 { --tilt: -0.8deg; } .t3 { --tilt: 1.5deg; }
.a0 { --accent: var(--orange); } .a1 { --accent: var(--green); } .a2 { --accent: var(--blue); }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.page-main { display: contents; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--mono); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 14px; height: 14px; background: var(--orange); border: 2px solid var(--ink); border-radius: 4px; transform: rotate(12deg); }
.top nav { display: flex; gap: 8px; font-family: var(--mono); font-size: 13px; }
.say-hi {
  text-decoration: none; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--bg); transition: transform .2s var(--spring);
}
.say-hi:hover { color: var(--bg); transform: translateY(-3px) rotate(3deg); }

/* hero */
.hero { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.hero h1 { margin: 0; font-size: clamp(52px, 9vw, 104px); line-height: .92; font-weight: 800; letter-spacing: -.035em; }
.hero .dot { color: var(--orange); }
.lede { margin: 0; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; color: var(--body); text-wrap: pretty; }

/* projects */
.projects { display: flex; flex-direction: column; gap: 24px; }
.proj-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.proj-head h2, .about h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.filter {
  display: flex; gap: 6px; padding: 4px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--surface); font-family: var(--mono); font-size: 13px;
}
.filter button {
  border: 0; cursor: pointer; white-space: nowrap; padding: 7px 14px; border-radius: 999px;
  background: transparent; color: var(--ink);
}
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; }

.card { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 18px; }
.card.public {
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 0 0 var(--ink);
  transition: transform .3s var(--spring), box-shadow .3s;
}
.card.public:hover { transform: translate(-5px, -5px) rotate(var(--tilt)); box-shadow: 7px 7px 0 var(--accent); }
.card.private {
  border: 2px dashed var(--dashed);
  background: repeating-linear-gradient(135deg, var(--bg) 0 10px, var(--stripe) 10px 20px);
  transition: transform .3s var(--spring), border-color .2s;
}
.card.private:hover { transform: rotate(var(--tilt)) scale(1.02); border-color: var(--ink); }

.shot {
  display: block; width: 100%; padding: 0; aspect-ratio: 16 / 10; border: 2px solid var(--ink);
  border-radius: 10px; overflow: hidden; background: #ece7df; cursor: pointer;
}
.card.private .shot { background: var(--ink); }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot img.pos-45-50 { object-position: 45% 50%; }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 4px 4px; flex: 1; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.card.private h3 { font-size: 21px; font-weight: 700; }
.card p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--body); text-wrap: pretty; flex: 1; }
.card.private p { font-size: 15px; }
.tag-private {
  display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); flex-shrink: 0;
}
.tag-private::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--dashed); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; padding-top: 6px; }
.pill {
  display: inline-block; cursor: pointer; text-decoration: none; font-weight: 600; padding: 6px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  transition: transform .2s var(--spring);
}
.pill.link { background: var(--live-tint); }
.pill.link:hover { color: var(--ink); transform: translateY(-2px) rotate(-2deg); }
button.pill:hover { transform: translateY(-2px) rotate(2deg); }

/* about */
.about { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; }
.about-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.about h2 { line-height: 1.05; }
.about-body {
  flex: 2 1 420px; min-width: 0; max-width: 68ch; display: flex; flex-direction: column; gap: 18px;
  font-size: 18px; line-height: 1.6; color: var(--body);
}
.about-body p { margin: 0; text-wrap: pretty; }
.about-body strong { color: var(--ink); }
.glossary {
  flex: 1 1 100%; min-width: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.gloss {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: 14px; transition: transform .3s var(--spring), box-shadow .3s;
}
.gloss:hover { transform: translate(-3px, -3px) rotate(var(--tilt)); box-shadow: 5px 5px 0 var(--accent); }
.gloss.g0 { --tilt: -1deg; --accent: var(--orange); }
.gloss.g1 { --tilt: 1deg; --accent: var(--green); }
.gloss.g2 { --tilt: -1deg; --accent: var(--blue); }
.gloss.g3 { --tilt: 1deg; --accent: var(--orange); }
.gloss b { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.gloss span { font-size: 15px; color: var(--body); }

/* footer */
.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px;
  border-top: 2px solid var(--ink); font-family: var(--mono); font-size: 13px; color: var(--muted);
}

/* modal */
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(28, 26, 23, .55); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  animation: fade .2s ease-out;
}
.dialog {
  width: 100%; max-width: 740px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 10px 10px 0 var(--accent); overflow: hidden; animation: pop .35s cubic-bezier(.3, 1.5, .5, 1);
}
.dialog-img { aspect-ratio: 16 / 10; border-bottom: 2px solid var(--ink); overflow: hidden; background: var(--ink); }
.dialog-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.dialog-img img.pos-45-50 { object-position: 45% 50%; }
.dialog-body { padding: 28px 28px 30px; display: flex; flex-direction: column; gap: 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.badge { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dialog h2 { margin: 0; font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.close {
  flex-shrink: 0; width: 40px; height: 40px; cursor: pointer; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--surface); font: 600 18px var(--mono); color: var(--ink); transition: transform .25s var(--spring);
}
.close:hover { transform: rotate(90deg); }
.dialog .about-text { margin: 0; font-size: 18px; line-height: 1.5; color: var(--body); text-wrap: pretty; }
.highlights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.highlights li { display: flex; gap: 12px; font-size: 16px; line-height: 1.45; color: var(--ink); }
.highlights li::before {
  content: ""; flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border: 2px solid var(--ink);
  border-radius: 3px; background: var(--accent); transform: rotate(45deg);
}
.dialog-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 14px; border-top: 2px dashed #d6d0c6;
}
.stack { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.stack span { padding: 4px 10px; border-radius: 999px; background: var(--chip); }
.dialog-links { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog-links .pill { font-family: var(--mono); font-size: 13px; padding: 8px 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card.public:hover, .card.private:hover, .gloss:hover, .say-hi:hover,
  .pill.link:hover, button.pill:hover, .close:hover { transform: none; }
}
