:root {
  color-scheme: light;
  --ink: #211e1f;
  --muted: #605659;
  --line: #cfd2cd;
  --paper: #fbfbf2;
  --cloud: #e5e6e4;
  --silver: #a6a2a2;
  --taupe: #847577;
  --night: #211d1e;
  --night-copy: #e3dbd5;
  font-family: "Instrument Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
h1, h2, h3, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.shell { width: min(82rem, calc(100% - clamp(2rem, 6vw, 7rem))); margin-inline: auto; }
.skip { position: absolute; inset: -5rem auto auto 1rem; z-index: 5; padding: .7rem; color: var(--paper); background: var(--night); }
.skip:focus { top: .6rem; }
.top { border-bottom: 1px solid var(--line); }
.top-inner { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(.5rem, 2vw, 1.5rem); }
.brand { display: inline-flex; align-items: center; gap: .65rem; justify-self: start; font-size: 1.16rem; font-weight: 850; letter-spacing: -.06em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: .35rem; background: var(--night); color: var(--paper); font-size: 1.38rem; font-weight: 500; }
.top nav, .section-head nav, .footer { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2rem); }
.top nav a { padding-block: .75rem; }
.top nav a, .section-head nav a, .footer a { color: var(--muted); font-size: .91rem; font-weight: 650; }
.top nav a:hover, .section-head nav a:hover, .footer a:hover, .breadcrumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
.login { justify-self: end; padding: .48rem .75rem; background: var(--cloud); border: 1px solid var(--line); border-radius: .4rem; color: var(--ink); font-size: .9rem; font-weight: 730; white-space: nowrap; }
.login:hover { background: var(--line); }

.eyebrow { color: var(--muted); font-size: .75rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 500; line-height: .92; letter-spacing: -.075em; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.8rem); font-weight: 780; line-height: 1.02; letter-spacing: -.055em; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .54rem .85rem; border: 1px solid transparent; border-radius: .35rem; font-size: .86rem; font-weight: 760; line-height: 1.2; }
.button span { margin-left: auto; }
.primary { background: var(--night); color: var(--paper); }
.primary:hover { background: #44373a; }
.secondary { border-color: var(--silver); }
.secondary:hover { background: var(--cloud); }
.text-action:hover { text-decoration: underline; text-underline-offset: .22em; }

.library { margin-block: 1.5rem 0; padding: clamp(1rem, 3vw, 1.7rem); border: 1px solid var(--line); border-left: .32rem solid var(--taupe); border-radius: .45rem; background: var(--cloud); }
.library h2 { font-size: 1.45rem; letter-spacing: -.04em; }
.library .section-head { margin-bottom: .7rem; }
.library-apps { display: flex; flex-wrap: wrap; gap: .65rem; }
.library-apps > a, .library-apps article a { display: inline-flex; align-items: center; min-height: 44px; gap: .6rem; padding: .5rem .8rem; background: var(--night); color: var(--paper); border-radius: .3rem; font-weight: 700; }
.library-apps > a:hover, .library-apps article a:hover { background: #44373a; }
#library-note { margin-top: .5rem; color: var(--muted); }

.mast { position: relative; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.38fr); align-items: center; gap: clamp(1.4rem, 4vw, 3.5rem); min-height: min(32rem, 42vw); margin-top: clamp(1.2rem, 4vw, 2.3rem); padding: clamp(1.3rem, 5vw, 4.4rem); overflow: hidden; border: 1px solid #3b3335; border-radius: .55rem; background: radial-gradient(ellipse at 85% 65%, #4c403d, transparent 65%), var(--night); color: var(--paper); }
.mast-copy { position: relative; }
.mast .eyebrow { color: #d1bfb5; }
.mast h1 { margin-block: .42rem .8rem; font-size: clamp(4rem, 8vw, 8rem); }
.lead { color: var(--paper); font-size: clamp(1.05rem, 2.3vw, 1.42rem); font-weight: 690; letter-spacing: -.026em; }
.mast-description { max-width: 27rem; margin-block: .35rem 1.4rem; color: var(--night-copy); }
.mast-actions, .card-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.mast .primary { background: var(--paper); color: var(--ink); }
.mast .primary:hover { background: var(--line); }
.mast .secondary { border-color: #89777c; }
.mast .secondary:hover { background: #44373a; }
.mast-photo { display: block; position: relative; overflow: hidden; border: 1px solid #9c896d; border-radius: .35rem; background: #2a2823; box-shadow: 0 1rem 2rem #08060670; }
.mast-photo > img { width: 100%; aspect-ratio: 1.62; object-fit: cover; }
.mast-photo > span { display: flex; justify-content: space-between; align-items: center; min-height: 2.45rem; padding: .32rem .8rem; color: var(--night-copy); background: #262320; font-size: .8rem; font-weight: 620; }
.mast-photo:hover > span { color: var(--paper); background: #332b27; }

.catalog { padding-block: clamp(2.1rem, 6vw, 4.15rem); scroll-margin-top: 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .7rem 1rem; margin-bottom: 1.25rem; }
.section-head nav { gap: .65rem; }
.section-head nav a { padding: .35rem .6rem; border: 1px solid var(--line); border-radius: .3rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.8rem, 2vw, 1.5rem); }
.card { display: flex; flex-direction: column; scroll-margin-top: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: .55rem; background: #f5f4eb; }
.card:target { outline: 3px solid var(--taupe); outline-offset: 4px; }
.card-photo { display: block; overflow: hidden; border-bottom: 1px solid var(--line); background: #3b392b; }
.card.creeperai .card-photo { background: #172c23; }
.card-photo img { width: 100%; aspect-ratio: 2.12; object-fit: cover; object-position: 50% 29%; }
.card-photo:hover img { transform: scale(1.02); }
.card-copy { display: flex; flex: 1; flex-direction: column; padding: clamp(1.05rem, 3vw, 1.65rem); }
.tags { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .8rem; color: var(--muted); font-size: .82rem; font-weight: 610; }
.status { display: inline-flex; padding: .2rem .5rem; border-radius: .24rem; background: var(--cloud); color: #4e4145; font-size: .74rem; font-weight: 750; white-space: nowrap; }
.card h3 { margin-top: .18rem; font-size: clamp(1.55rem, 3vw, 2.45rem); font-weight: 790; letter-spacing: -.064em; }
.card p { max-width: 37rem; margin: .15rem 0 1.15rem; color: var(--muted); }
.card-actions { margin-top: auto; }
.about { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); gap: .9rem 3rem; margin-bottom: 1.5rem; padding-block: 1.9rem; border-top: 1px solid var(--line); }
.about p { max-width: 50rem; font-size: 1.03rem; color: var(--muted); }
.about p + p { margin-top: .65rem; }
.about .button { margin-top: .9rem; }
.footer { justify-content: space-between; flex-wrap: wrap; min-height: 84px; padding-block: 1.15rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer .brand { color: var(--ink); font-size: 1.05rem; }

.product-page { --product-ink: #28261f; --product-accent: #e8dbc0; --product-copy: #f0e5d2; --product-edge: #68604a; }
.product-page.creeperai { --product-ink: #14221c; --product-accent: #c5eb8b; --product-copy: #e1ebdf; --product-edge: #4a6955; }
.breadcrumb { display: flex; gap: .73rem; margin-top: 1.4rem; color: var(--muted); font-size: .85rem; }
.detail-title { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.2rem); padding-block: 1.45rem 1.2rem; }
.detail-title h1 { margin-top: .32rem; font-size: clamp(3.15rem, 8vw, 6.8rem); }
.creeperai .detail-title h1 { font-family: "Instrument Sans", Inter, system-ui, sans-serif; font-size: clamp(2.6rem, 6.3vw, 5.75rem); font-weight: 850; letter-spacing: -.075em; }
.detail-title .status { align-self: end; margin-left: auto; }
.project-icon { width: clamp(2.45rem, 7vw, 4.35rem); height: auto; border-radius: .45rem; }
.showcase { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(14rem, .83fr); gap: clamp(1rem, 3vw, 2rem); align-items: start; margin-bottom: 2.15rem; padding: clamp(.8rem, 3vw, 1.65rem); border-radius: .55rem; color: var(--paper); background: var(--product-ink); }
.gallery { min-width: 0; grid-column: 1; grid-row: 1; }
.gallery figure > a { display: block; overflow: hidden; border: 1px solid var(--product-edge); border-radius: .3rem; }
.gallery figure img { width: 100%; aspect-ratio: 1.6; object-fit: contain; background: #161616; }
.gallery figcaption { padding: .42rem 0 0; color: var(--product-copy); font-size: .84rem; }
.thumbs { display: flex; gap: .55rem; padding-block: .65rem; }
.thumbs a { flex: 0 1 8rem; min-width: 0; border: 2px solid var(--product-edge); border-radius: .25rem; overflow: hidden; }
.thumbs a:hover, .thumbs a[aria-current="true"] { border-color: var(--product-accent); }
.thumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.media-note { color: var(--product-copy); font-size: .8rem; }
.lightbox { width: max-content; max-width: calc(100% - 1rem); max-height: calc(100% - 1rem); padding: .65rem; border: 1px solid var(--product-edge); border-radius: .4rem; background: var(--product-ink); color: var(--paper); }
.lightbox::backdrop { background: #151214df; }
.lightbox-controls { display: flex; gap: .42rem; margin-bottom: .55rem; }
.lightbox-controls [data-gallery-close] { margin-left: auto; }
.lightbox-controls button { min-height: 44px; min-width: 44px; padding: .4rem .7rem; border: 1px solid var(--product-edge); border-radius: .24rem; background: var(--product-ink); color: var(--paper); cursor: pointer; font: inherit; }
.lightbox-controls button:hover { background: var(--product-accent); color: var(--product-ink); }
.lightbox img { max-height: 75vh; object-fit: contain; }
.lightbox p { padding: .5rem .1rem 0; color: var(--product-copy); font-size: .88rem; }
.project-summary { grid-column: 2; grid-row: 1; min-width: 0; padding: clamp(.3rem, 2vw, 1.3rem); }
.project-summary h2 { margin-block: .2rem .75rem; }
.project-summary p, .project-summary small { color: var(--product-copy); }
.project-summary .button { margin-top: 1.1rem; color: var(--product-ink); background: var(--product-accent); }
.project-summary .button:hover { background: var(--paper); }
.project-summary small { display: block; margin-top: .8rem; }
.highlights { margin-block: .8rem 3rem; }
.highlights > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1.15rem; }
.highlights article { padding: clamp(.85rem, 2.5vw, 1.35rem); border: 1px solid var(--line); border-radius: .35rem; background: #f5f4eb; }
.highlights h3 { margin-bottom: .38rem; font-size: 1.03rem; font-weight: 780; }
.highlights p { color: var(--muted); font-size: .94rem; }

@media (max-width: 820px) {
  .mast { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); }
  .mast h1 { font-size: clamp(3.6rem, 9vw, 5.8rem); }
}
@media (max-width: 650px) {
  .top-inner { min-height: 0; grid-template-columns: minmax(0, 1fr) auto; gap: .28rem .55rem; padding-block: .7rem .25rem; }
  .top nav { grid-row: 2; grid-column: 1 / -1; justify-content: start; gap: 1rem; }
  .top nav a { padding-block: .48rem; }
  .brand { gap: .46rem; font-size: 1.04rem; }
  .brand-mark { width: 1.85rem; height: 1.85rem; }
  .mast, .cards, .showcase, .about, .highlights > div { grid-template-columns: minmax(0, 1fr); }
  .mast { min-height: 0; }
  .mast h1 { font-size: clamp(3.5rem, 14vw, 5.8rem); }
  .gallery, .project-summary { grid-column: auto; grid-row: auto; }
  .project-summary { padding: .4rem; }
  .detail-title { flex-wrap: wrap; }
  .detail-title .status { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .card-photo img { transition: transform 180ms ease-out; }
}
