/* Zagwa site — shared design system for zagwa.com and zagwa.org.
   Old-school minimalist dark: Alegreya serif headings, Alegreya Sans body. */
:root {
  --bg: #0a0a0a; --fg: #e9e7e2; --muted: #8a8a82; --soft: #c9c7bf;
  --rule: #232320; --link: #d9c9a3; --link-rule: #4a4334;
  --serif: 'Alegreya', Georgia, serif; --sans: 'Alegreya Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { color: var(--fg); font-family: var(--sans); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid var(--link-rule); }
a:hover { border-bottom-color: var(--link); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; overflow-wrap: normal;
  hyphens: none; word-break: keep-all; }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px 8vh; }
.narrow { max-width: 760px; }

/* nav */
.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  padding: 28px 0 0; font-size: 15px; }
.nav .brand { font-family: var(--serif); font-size: 22px; color: var(--fg); border: none;
  margin-right: auto; }
.nav a:not(.brand) { color: var(--muted); border: none; }
.nav a:not(.brand):hover { color: var(--link); }
.nav .xlink { color: var(--link-rule); }

/* hero */
.hero { padding: 9vh 0 2vh; }
.hero.split { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: center; }
.hero.split .tagline { font-size: 34px; margin: 0 0 .6em; max-width: none; }
.hero .wide-line { max-width: none; white-space: nowrap; }
.hero-gif { width: 300px; height: 300px; border-radius: 8px; }
.page-q { font-size: 40px; margin: 0 0 .3em; line-height: 1.15; font-style: italic; color: var(--fg); }

/* ask */
.ask { display: flex; gap: 0; margin: 1.6em 0 0; max-width: 420px; border-bottom: 1px solid var(--link-rule); }
.ask input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--fg);
  font-family: var(--serif); font-size: 21px; padding: .3em 0; outline: none; }
.ask input::placeholder { color: var(--muted); font-style: italic; }
.ask button { background: none; border: none; color: var(--link); font-size: 24px; cursor: pointer;
  padding: 0 .2em; }
.ask:focus-within { border-bottom-color: var(--link); }

/* landing carousel */
.carousel { position: relative; margin-top: auto; padding-top: 3vh; display: grid; }
.carousel .slide { grid-area: 1 / 1; opacity: 0; transition: opacity .9s ease;
  border: none; color: var(--fg); display: grid; grid-template-columns: 1fr 340px;
  gap: 8px 40px; align-items: center; pointer-events: none; padding-top: 1.4em; border-top: 1px solid var(--rule); }
.carousel .visual { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; min-height: 150px; }
.carousel .v-logo { gap: 26px; }
.carousel .big img { max-width: 160px; max-height: 72px; width: auto; height: auto;
  filter: grayscale(1) brightness(1.55) contrast(.95); opacity: .85; }
.carousel .big.tech img { max-height: 56px; }
.carousel .big.invert img { filter: invert(1) grayscale(1) brightness(1.1); }
.carousel .line b { color: var(--link); font-weight: 400; }
.carousel .visual .shot { width: 340px; height: 170px; object-fit: cover; object-position: center; border-radius: 6px; border: 1px solid var(--rule); display: block; }
.talk { width: 320px; max-width: 100%; border-radius: 6px; border: 1px solid var(--rule); display: block; margin: 0 0 1em; }
.carousel .v-logos { display: grid; grid-template-columns: repeat(4, 66px); gap: 14px 12px; align-items: center; }
.carousel .mini img { max-width: 66px; max-height: 24px; width: auto; height: auto; display: block; margin: 0 auto;
  filter: grayscale(1) brightness(1.55) contrast(.95); opacity: .8; }
.carousel .mini.invert img { filter: invert(1) grayscale(1) brightness(1.1); }

.carousel .slide.on { opacity: 1; pointer-events: auto; }
.carousel .stat { font-family: var(--serif); font-size: 40px; line-height: 1.05; color: var(--link); }
.carousel .line { font-family: var(--serif); font-size: 23px; line-height: 1.4; color: var(--soft); max-width: 34ch; grid-column: 1; }
.carousel .slide:hover .line { color: var(--fg); }
.carousel .dots { position: absolute; right: 0; top: 3vh; display: flex; gap: 8px; padding-top: .5em; }
.carousel .dots button { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--link-rule); background: none;
  padding: 0; cursor: pointer; }
.carousel .dots button.on { background: var(--link); border-color: var(--link); }

/* landing doors */
.doors { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.doors a { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 24px;
  padding: .55em 0; border: none; border-bottom: 1px solid var(--rule); color: var(--fg); }
.doors a span { color: var(--link); }
.doors a:hover { color: var(--link); }

/* landing: one screen, no scroll on desktop */
.wrap.landing { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 4vh; }
.wrap.landing .hero { padding: 6vh 0 2vh; }
.wrap.landing #clients { margin-top: auto; padding-top: 3vh; }
.wrap.landing footer { margin-top: 3vh; }
.logos.four { grid-template-columns: repeat(8, 1fr); gap: 22px 28px; }
.logos.four img { max-width: 110px; }
.suggest { list-style: none; margin: .6em 0 0; padding: 0; max-width: 420px; }
.suggest li a { display: block; font-family: var(--serif); font-size: 19px; color: var(--soft);
  border: none; padding: .25em 0; }
.suggest li a:hover { color: var(--link); }
.suggest li a::before { content: "\2192\00a0"; color: var(--link-rule); }

/* clients picker */
.logos.picker .logo { background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  padding: 6px; height: 60px; transition: opacity .25s, border-color .25s; }
.logos.picker .logo:hover { border-color: var(--rule); }
.logos.picker .logo.on { border-color: var(--link-rule); }
.logos.picker .logo.on img { opacity: 1; filter: grayscale(0) brightness(1.2); }
.logos.picker .logo.on.invert img { filter: invert(1) grayscale(0) brightness(1.1); }
.logos.picker .logo.off { opacity: .35; }
.account { min-height: 120px; margin-top: 2em; padding-top: 1.4em; border-top: 1px solid var(--rule); max-width: 62ch; }
.account .hint { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 19px; }
.account h3 { font-size: 26px; margin: 0 0 .3em; }
.account .did { color: var(--fg); font-size: 19px; margin: 0 0 .3em; }
.account .did.muted { color: var(--muted); font-style: italic; }
.account .helped { color: var(--link); font-family: var(--serif); font-style: italic; font-size: 19px; margin: 0; }
.account .more { font-size: 15px; margin-top: .8em; }
.vals li span { display: block; color: var(--soft); font-size: 15px; margin-top: .2em; line-height: 1.45; }

/* contact form */
.cform { max-width: 560px; }
.cform label { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase;
  letter-spacing: .14em; margin: 0 0 1.2em; }
.cform input, .cform textarea { display: block; width: 100%; margin-top: .4em; background: transparent;
  border: none; border-bottom: 1px solid var(--link-rule); color: var(--fg); font-family: var(--serif);
  font-size: 20px; padding: .3em 0; outline: none; text-transform: none; letter-spacing: 0; resize: vertical; }
.cform input:focus, .cform textarea:focus { border-bottom-color: var(--link); }
.cform .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cform .hp { position: absolute; left: -9999px; }
.cform button { background: none; border: 1px solid var(--link-rule); color: var(--link); font-family: var(--serif);
  font-size: 20px; padding: .35em 1em; cursor: pointer; border-radius: 4px; }
.cform button:hover { border-color: var(--link); }
.err { color: var(--link); font-style: italic; }
@media (max-width: 560px) { .cform .row2 { grid-template-columns: 1fr; gap: 0; } }

.push { margin-top: 5em; padding-top: 1.4em; border-top: 1px solid var(--rule);
  font-family: var(--serif); font-size: 21px; }
.push p { margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 22px 40px; margin: 1.6em 0 .4em; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.posts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.posts li { padding: .65em 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.posts .yrs { color: var(--muted); font-size: 13px; margin-right: .8em; }
.posts .desc { display: block; color: var(--muted); font-size: 15px; margin-top: .1em; }
.wordmark { font-size: 48px; letter-spacing: .02em; margin: 0 0 .15em; line-height: 1.1; }
.tagline { font-size: 24px; line-height: 1.4; margin: 0 0 .9em; max-width: 30ch;
  font-family: var(--serif); }
.intro { color: var(--muted); max-width: 56ch; margin: 0 0 1em; }
.aside { color: var(--muted); font-size: 14px; max-width: 56ch; font-style: italic; }

section { margin-top: 5em; }
section[id] { scroll-margin-top: 24px; }
.label { text-transform: uppercase; letter-spacing: .22em; font-size: 12px;
  color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: .5em;
  margin-bottom: 1.4em; display: flex; justify-content: space-between; gap: 1em; }
.label a { border: none; letter-spacing: .06em; text-transform: none; font-size: 13px; }
.lede { color: var(--soft); max-width: 60ch; margin: -.4em 0 1.6em; }

/* logo wall */
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 26px 28px; align-items: center; margin: 1.2em 0 .6em; }
.logos .logo { display: flex; align-items: center; justify-content: center; height: 44px; }
.logos img { max-height: 34px; max-width: 120px; width: auto; height: auto;
  filter: grayscale(1) brightness(1.55) contrast(.95); opacity: .78;
  transition: opacity .2s; }
.logos .invert img { filter: invert(1) grayscale(1) brightness(1.1); }
.logos .logo:hover img { opacity: 1; }
.logos .text { font-family: var(--serif); font-size: 19px; color: var(--soft);
  opacity: .8; text-align: center; line-height: 1.15; }
.logos-caption { color: var(--muted); font-size: 14px; }

/* three hats */
.hats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.hat h3 { font-size: 26px; margin: 0; }
.hat-icon { width: 72px; height: 48px; color: var(--link); display: block; opacity: .9; }
.hat-btn { background: none; border: none; padding: 0; margin: 0 0 12px -6px; cursor: pointer;
  display: block; transform-origin: 50% 90%; transition: transform .35s cubic-bezier(.2,.8,.2,1), filter .35s; }
.hat-img { width: 170px; height: 170px; display: block; filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)); }
.hat-btn:hover, .hat-btn:focus-visible { transform: translateY(-8px) rotate(-6deg); outline: none; }
.hat.worn .hat-btn { transform: translateY(-4px) rotate(-10deg) scale(1.04); filter: drop-shadow(0 0 22px rgba(217,201,163,.35)); }
.hat.dim { opacity: .45; transition: opacity .35s; }
.hat.worn h3 { color: var(--link); }
.case[hidden] { display: none; }
.hat .line { color: var(--muted); font-style: italic; font-family: var(--serif);
  margin: .1em 0 .7em; }
.hat ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.hat li { padding: .5em 0; border-bottom: 1px solid var(--rule); }
.hat li a { font-family: var(--serif); font-size: 18px; }

/* project cards */
.proj { margin: 0 0 2.2em; display: flex; gap: 22px; align-items: flex-start; }
.proj-text { flex: 1; min-width: 0; }
.proj-shot { flex: none; width: 300px; border: none; }
.proj-shot img { width: 300px; height: auto; border-radius: 6px; border: 1px solid var(--rule); background: #fff;
  display: block; margin-top: 4px; }
.proj h3 { font-size: 23px; margin: 0; display: inline; }
.proj .meta { color: var(--muted); font-size: 14px; margin-left: .5em; }
.proj .status { font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--bg); background: var(--muted); border-radius: 3px; padding: 1px 6px;
  margin-left: .5em; vertical-align: 2px; }
.proj p { margin: .35em 0 0; color: var(--soft); max-width: 58ch; }
.proj .q { color: var(--muted); font-style: italic; font-family: var(--serif);
  font-size: 17px; }
.proj .more { font-size: 14px; margin-left: .6em; white-space: nowrap; }
.tags { display: inline-flex; gap: 6px; margin-left: .6em; vertical-align: 2px; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 3px; padding: 0 6px; }

/* open-source rows */
.oss { border-top: 1px solid var(--rule); }
.oss-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px;
  padding: .85em 0; border-bottom: 1px solid var(--rule); }
.oss-row h3 { font-size: 20px; margin: 0; }
.oss-row p { margin: .2em 0 0; color: var(--soft); font-size: 16px; max-width: 62ch;
  grid-column: 1 / -1; }
.oss-row .gh { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.oss-row .gh a { border: none; color: var(--muted); }
.oss-row .gh a:hover { color: var(--link); }

/* about */
.about p { color: var(--soft); max-width: 62ch; }
.exp { list-style: none; padding: 0; margin: 1em 0 0; border-top: 1px solid var(--rule); }
.exp li { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; padding: .7em 0;
  border-bottom: 1px solid var(--rule); font-size: 15px; }
.exp .yrs { color: var(--muted); }
.exp .role { color: var(--fg); }
.exp .org { color: var(--muted); }
.exp .note { grid-column: 2; color: var(--soft); }
.talks { color: var(--soft); }
.talks b { font-weight: 500; color: var(--fg); }

/* detail page */
.detail .kicker { color: var(--muted); font-size: 14px; letter-spacing: .06em;
  text-transform: uppercase; }
.detail h1 { font-size: 40px; margin: .2em 0 .2em; line-height: 1.15; }
.detail .q { font-family: var(--serif); font-style: italic; font-size: 22px;
  color: var(--soft); max-width: 34ch; margin: 0 0 1em; }
.detail .meta { color: var(--muted); font-size: 15px; margin-bottom: 2em; }
.detail .meta a { margin-right: 1em; }
.detail .body h2 { font-size: 22px; margin: 1.8em 0 .3em; color: var(--link); }
.detail .body p, .detail .body li { color: var(--soft); max-width: 62ch; }
.detail .body a { color: var(--link); }
.detail .hero-img { border: 1px solid var(--rule); border-radius: 6px; margin: 0 0 2em; display: block; }

.contact { color: var(--muted); max-width: 56ch; }
footer { margin-top: 6em; padding-top: 1.4em; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 13px; }

@media (max-width: 1000px) { .logos.four { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  body { font-size: 17px; }
  .wordmark { font-size: 40px; }
  .tagline { font-size: 21px; }
  .hats { grid-template-columns: 1fr; gap: 26px; }
  .proj { flex-direction: column; gap: 8px; }
  .proj-shot, .proj-shot img { width: 100%; max-width: 360px; }
  .hero.split { grid-template-columns: 1fr; gap: 18px; }
  .hero.split .tagline { font-size: 26px; }
  .hero .wide-line { white-space: normal; }
  .hero-gif { width: 140px; height: 140px; order: -1; }
  .wrap.landing .hero { padding-top: 3vh; }
  .carousel .slide { grid-template-columns: 1fr 110px; gap: 6px 14px; align-items: start; padding-bottom: 2em; }
  .carousel .visual .shot { height: auto; }
  .carousel .line { grid-column: 1; font-size: 19px; }
  .carousel .visual { grid-column: 2; min-height: 0; align-self: start; justify-content: flex-end; }
  .carousel .visual .shot { width: 110px; max-height: 110px; }
  .carousel .v-logo { flex-direction: column; gap: 10px; align-items: flex-end; }
  .carousel .big img { max-width: 100px; max-height: 34px; }
  .carousel .big.tech img { max-height: 30px; }
  .carousel .v-logos { grid-template-columns: repeat(2, 50px); gap: 10px 8px; }
  .carousel .mini img { max-width: 50px; max-height: 18px; }
  .carousel .stat { font-size: 30px; }
  .carousel .line { font-size: 18px; }
  .carousel .dots { position: absolute; bottom: .4em; top: auto; right: auto; left: 0; padding: 0; }
  .nav { gap: 6px 14px; font-size: 14px; }
  .hat-img { width: 120px; height: 120px; }
  .hats { gap: 34px; }
  .logos.picker .logo { height: 52px; padding: 4px; }
  .account { min-height: 90px; }
  .page-q { font-size: 32px; }
  .exp li { grid-template-columns: 1fr; }
  .exp .note { grid-column: 1; }
  .logos, .logos.four { grid-template-columns: repeat(3, 1fr); gap: 18px 12px; }
  .logos img, .logos.four img { max-width: 84px; max-height: 28px; }
  .logos .logo, .logos.picker .logo { min-width: 0; }
  .nav { gap: 4px 12px; font-size: 13px; }
  .nav .brand { font-size: 20px; }
  .wrap { padding: 0 20px 8vh; }
  .wrap.landing { min-height: 0; display: block; }
  .logos img { max-width: 96px; max-height: 30px; }
  .oss-row { grid-template-columns: 1fr; }
  .oss-row .gh { text-align: left; }
  .detail h1 { font-size: 32px; }
}
