/* Recursivity — portfolio styles
   Monochrome-first, taking its cue from the logo: near-black ink on warm paper,
   with one accent reserved for links and the open-source marker. */

:root {
  --paper:       #faf9f7;
  --card:        #ffffff;
  --ink:         #17171a;
  --ink-soft:    #3d3b38;
  --muted:       #6f6b64;
  --faint:       #9a958c;
  --line:        #e6e3dd;
  --line-strong: #d5d1c9;
  --accent:      #1f5c46;
  --accent-soft: #e8f0eb;
  --slate:       #46505c;
  --slate-soft:  #eceef1;
  --gold:        #8a6413;
  --gold-soft:   #f6efdd;
  --shadow:      0 1px 2px rgba(23, 23, 26, .04), 0 8px 24px -12px rgba(23, 23, 26, .16);
  --shadow-lift: 0 2px 4px rgba(23, 23, 26, .06), 0 18px 40px -18px rgba(23, 23, 26, .28);
  --radius:      14px;
  --measure:     68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #131315;
    --card:        #1b1b1e;
    --ink:         #f2f0ec;
    --ink-soft:    #d8d4cd;
    --muted:       #9e9a92;
    --faint:       #75716a;
    --line:        #2b2b30;
    --line-strong: #3a3a41;
    --accent:      #7fc0a3;
    --accent-soft: #1c2b25;
    --slate:       #a8b2c0;
    --slate-soft:  #23262b;
    --gold:        #dcb765;
    --gold-soft:   #2e2717;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 18px 40px -18px rgba(0, 0, 0, .9);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: var(--slate-soft);
  border-radius: 5px;
  padding: .12em .38em;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 860px; }

/* ---------- Header ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 36px; width: auto; object-fit: contain; }

/* The marks are transparent PNGs of black artwork, so a straight invert flips
   the ink to paper without dragging a background box along with it. */
@media (prefers-color-scheme: dark) {
  .brand img { filter: invert(1); }
}

.masthead__nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.masthead__nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.masthead__nav a:hover { color: var(--ink); }
.masthead__nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

@media (max-width: 640px) {
  .brand img { height: 30px; }
  .masthead__nav { gap: 15px; font-size: 14px; }
}

/* The wordmark and three nav links can't share one row on a phone.
   The icon alone carries the brand; the nav is what people need to tap. */
@media (max-width: 520px) {
  .brand__text { display: none; }
  .wrap { padding: 0 18px; }
}

/* ---------- Hero ---------- */

.hero { padding: 64px 0 8px; }
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 18px;
  font-weight: 700;
}
.hero p {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: clamp(1.03rem, 2vw, 1.15rem);
  margin: 0 0 14px;
}

/* ---------- Section headings ---------- */

.section { padding: 56px 0 8px; scroll-margin-top: 80px; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.section__head h2 {
  font-size: 1.6rem;
  letter-spacing: -.02em;
  margin: 0;
  font-weight: 700;
}

.section__count { color: var(--faint); font-size: .92rem; font-variant-numeric: tabular-nums; }
.section__lede { max-width: var(--measure); color: var(--muted); margin: -18px 0 30px; font-size: .98rem; }

/* ---------- Project cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.card__top { display: flex; align-items: flex-start; gap: 14px; }

.card__icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  object-fit: cover;
  overflow: hidden;
}

.card__icon--mono {
  display: grid;
  place-items: center;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--muted);
  background: var(--slate-soft);
}

.card h3 { margin: 0 0 2px; font-size: 1.16rem; letter-spacing: -.015em; font-weight: 700; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card__sub { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.card__body { margin: 0; color: var(--ink-soft); font-size: .95rem; flex: 1 1 auto; }

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- Tags & badges ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }

.tag {
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  background: var(--slate-soft);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 11px;
}

.badge--oss { color: var(--accent); background: var(--accent-soft); }
.badge--private { color: var(--slate); background: var(--slate-soft); }
.badge--featured { color: var(--gold); background: var(--gold-soft); }
.badge--featured svg { width: 11px; height: 11px; }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Featured cards ---------- */

/* Their own two-up track, so a wide card never leaves a hole in the
   three-column grid that follows it. */
.grid--featured {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  margin-bottom: 20px;
}

.card--featured { padding: 28px; border-color: var(--line-strong); }
.card--featured .card__icon { width: 64px; height: 64px; border-radius: 15px; }
.card--featured h3 { font-size: 1.4rem; margin-top: 2px; }
.card--featured .card__sub { font-size: .97rem; }
.card--featured .card__body { font-size: 1rem; }
.card--featured .badge { margin-bottom: 7px; }

@media (max-width: 420px) {
  .card--featured { padding: 22px; }
  .card--featured .card__icon { width: 52px; height: 52px; border-radius: 12px; }
  .card--featured h3 { font-size: 1.2rem; }
}

/* ---------- Links ---------- */

.link-arrow {
  position: relative;
  z-index: 1;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-arrow:hover { color: var(--ink); }
.link-arrow svg { width: 14px; height: 14px; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  margin-bottom: 26px;
}
.backlink:hover { color: var(--ink); }

/* ---------- Project page ---------- */

.project { padding: 46px 0 0; }

.project__eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.project h1 {
  font-size: clamp(2rem, 5.5vw, 2.85rem);
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0 0 10px;
  font-weight: 700;
}

.project__sub {
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  color: var(--muted);
  margin: 0 0 26px;
  max-width: var(--measure);
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  margin-bottom: 34px;
  font-size: .9rem;
}

.meta div { display: flex; flex-direction: column; gap: 1px; }
.meta dt, .meta__label { color: var(--faint); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.meta dd, .meta__value { margin: 0; color: var(--ink-soft); font-weight: 500; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 20px; color: var(--ink-soft); }
.prose h2 {
  font-size: 1.32rem;
  letter-spacing: -.015em;
  margin: 44px 0 14px;
  font-weight: 700;
  color: var(--ink);
}
.prose h3 { font-size: 1.05rem; margin: 30px 0 10px; font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose > :first-child { margin-top: 0; }

.feature-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.feature-list li { position: relative; padding-left: 26px; color: var(--ink-soft); }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.feature-list b { color: var(--ink); font-weight: 650; }

.callout {
  border-left: 3px solid var(--line-strong);
  background: var(--card);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: .95rem;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 12px; }
.callout strong { color: var(--ink); }

/* Stack table */
.stack { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: .93rem; }
.stack th, .stack td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.stack th { width: 34%; color: var(--muted); font-weight: 600; padding-right: 18px; }
.stack td { color: var(--ink-soft); }
.stack tr:last-child th, .stack tr:last-child td { border-bottom: 0; }

/* ---------- Media / carousel ---------- */

.shot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 34px;
}

.shot__caption { color: var(--faint); font-size: .84rem; margin: 12px 4px 0; text-align: center; }

.glide__slide { display: flex; justify-content: center; align-items: center; }
.glide__slide img { width: auto; max-width: 100%; max-height: 620px; border-radius: 8px; }
.glide__slides { align-items: center; }

/* Per-slide caption: says what the frame is showing, not what the set is. */
.glide__slide figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.glide__slide figcaption {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
  margin-top: 11px;
  max-width: 62ch;
  text-align: center;
}

.glide__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: .9;
}
.glide__arrow:hover { opacity: 1; }
.glide__arrow--left { left: -6px; }
.glide__arrow--right { right: -6px; }

.glide__bullets { display: flex; justify-content: center; gap: 7px; margin-top: 14px; }
.glide__bullet {
  width: 7px; height: 7px; padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--line-strong);
  cursor: pointer;
}
.glide__bullet--active { background: var(--ink); }

/* Screenshot placeholder — a deliberate, labelled slot, not a broken image */
.shot-slot {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--line) 45%, transparent) 14px 15px),
    var(--card);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 56px 24px;
  margin-bottom: 34px;
  min-height: 260px;
}

.shot-slot__inner { max-width: 44ch; }
.shot-slot svg { width: 30px; height: 30px; color: var(--faint); margin: 0 auto 12px; display: block; }
.shot-slot b { display: block; color: var(--ink-soft); font-size: .98rem; margin-bottom: 5px; }
.shot-slot span { color: var(--faint); font-size: .86rem; line-height: 1.5; }
.shot-slot code { background: transparent; color: var(--muted); }

/* ---------- Buttons ---------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { opacity: .88; }

/* ---------- Sub-project blocks (Omarchy page) ---------- */

.subproject {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
  scroll-margin-top: 84px;
}

.subproject__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.subproject h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.015em; font-weight: 700; }
.subproject__sub { color: var(--muted); font-size: .93rem; margin: 0 0 18px; }
.subproject p { color: var(--ink-soft); font-size: .96rem; margin: 0 0 16px; }
.subproject p:last-child { margin-bottom: 0; }

.subproject__media {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.subproject__media img { border-radius: 10px; border: 1px solid var(--line); }

@media (max-width: 700px) {
  .subproject__media { grid-template-columns: 1fr; gap: 18px; }
  .subproject__media img { max-width: 320px; }
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}
.jump a {
  display: inline-block;
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  background: var(--card);
}
.jump a:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  color: var(--faint);
  font-size: .88rem;
}
.site-footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

.card__icon--mono svg { width: 34px; height: 34px; color: var(--muted); }
